Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
4673e6c2
Commit
4673e6c2
authored
Jul 26, 2022
by
万齐军
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
事件埋点修改
parent
385cfcd1
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
69 additions
and
37 deletions
+69
-37
AudioHomeActivity.kt
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
+5
-2
YDLavManager.kt
m-audioim/src/main/java/com/ydl/audioim/YDLavManager.kt
+3
-2
WatchMessagePictureActivity.java
m-im/src/main/java/com/yidianling/uikit/business/session/activity/WatchMessagePictureActivity.java
+2
-2
WatchVideoActivity.java
m-im/src/main/java/com/yidianling/uikit/business/session/activity/WatchVideoActivity.java
+2
-2
YDLMessageFragment.java
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
+1
-1
MessageListPanelEx.java
m-im/src/main/java/com/yidianling/uikit/business/session/module/list/MessageListPanelEx.java
+3
-4
MsgViewHolderAudio.java
m-im/src/main/java/com/yidianling/uikit/business/session/viewholder/MsgViewHolderAudio.java
+2
-2
MsgViewHolderBase.java
m-im/src/main/java/com/yidianling/uikit/business/session/viewholder/MsgViewHolderBase.java
+2
-2
LoginObservable.kt
m-user/src/main/java/com/yidianling/user/rxlogin/LoginObservable.kt
+1
-1
OneKeyLoginHelp.kt
m-user/src/main/java/com/yidianling/user/ui/login/OneKeyLoginHelp.kt
+3
-3
InputPassWordPresenterImpl.kt
m-user/src/main/java/com/yidianling/user/ui/login/presenter/InputPassWordPresenterImpl.kt
+3
-3
LoginPresenterImpl.kt
m-user/src/main/java/com/yidianling/user/ui/login/presenter/LoginPresenterImpl.kt
+4
-4
VerificationCodePresenterImpl.kt
m-user/src/main/java/com/yidianling/user/ui/login/presenter/VerificationCodePresenterImpl.kt
+6
-6
ApmInit.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/app/ApmInit.kt
+29
-0
HttpConfig.kt
ydl-platform/src/main/java/com/ydl/ydlcommon/base/config/HttpConfig.kt
+3
-3
No files found.
m-audioim/src/main/java/com/ydl/audioim/AudioHomeActivity.kt
View file @
4673e6c2
...
@@ -48,6 +48,7 @@ import com.ydl.ydl_av.voice.listener.IYDLVoiceEventHandler
...
@@ -48,6 +48,7 @@ import com.ydl.ydl_av.voice.listener.IYDLVoiceEventHandler
import
com.ydl.ydl_av.voice.manager.YDLVoiceManager
import
com.ydl.ydl_av.voice.manager.YDLVoiceManager
import
com.ydl.ydl_image.config.SimpleImageOpConfiger
import
com.ydl.ydl_image.config.SimpleImageOpConfiger
import
com.ydl.ydl_image.manager.YDLImageCacheManager
import
com.ydl.ydl_image.manager.YDLImageCacheManager
import
com.ydl.ydlcommon.app.Apm
import
com.ydl.ydlcommon.base.BaseMvpActivity
import
com.ydl.ydlcommon.base.BaseMvpActivity
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.modular.findRouteService
import
com.ydl.ydlcommon.modular.findRouteService
...
@@ -318,6 +319,7 @@ class AudioHomeActivity :
...
@@ -318,6 +319,7 @@ class AudioHomeActivity :
if
(
err
==
0
||
err
==
18
)
{
if
(
err
==
0
||
err
==
18
)
{
return
return
}
}
Apm
.
reportEvent
(
"agora_android"
,
"occur_error"
,
"$err"
)
channelId
?.
let
{
YDLavManager
.
instances
.
callEndStatusUpdate
(
it
,
4
,
"频道的错误回调信息$err"
)
}
channelId
?.
let
{
YDLavManager
.
instances
.
callEndStatusUpdate
(
it
,
4
,
"频道的错误回调信息$err"
)
}
}
}
...
@@ -369,8 +371,8 @@ class AudioHomeActivity :
...
@@ -369,8 +371,8 @@ class AudioHomeActivity :
override
fun
onRtcStats
(
stats
:
IRtcEngineEventHandler
.
RtcStats
?)
{
override
fun
onRtcStats
(
stats
:
IRtcEngineEventHandler
.
RtcStats
?)
{
super
.
onRtcStats
(
stats
)
super
.
onRtcStats
(
stats
)
writeAgoraLog
(
"声网onRtcStats:users:${stats?.users}"
)
writeAgoraLog
(
"声网onRtcStats:users:${stats?.users}"
)
AliYunRichLogsHelper
.
getInstance
()
//
AliYunRichLogsHelper.getInstance()
.
sendRichLog
(
AliYunLogConfig
.
AGORA
,
"声网onRtcStats:users:${stats?.users} channelId:${channelId}"
)
//
.sendRichLog(AliYunLogConfig.AGORA, "声网onRtcStats:users:${stats?.users} channelId:${channelId}")
// 不需要移动端做离开房间逻辑,服务端会判断进行踢人逻辑
// 不需要移动端做离开房间逻辑,服务端会判断进行踢人逻辑
//因为用户端直接加入了频道,防止该回调执行时,专家还未加入频道,因此在连接成功之后,才进行频道人数判断
//因为用户端直接加入了频道,防止该回调执行时,专家还未加入频道,因此在连接成功之后,才进行频道人数判断
// if (isConnectSuccess && null != stats?.users && stats.users == 1) {
// if (isConnectSuccess && null != stats?.users && stats.users == 1) {
...
@@ -388,6 +390,7 @@ class AudioHomeActivity :
...
@@ -388,6 +390,7 @@ class AudioHomeActivity :
override
fun
onConnectionStateChanged
(
state
:
Int
,
reason
:
Int
)
{
override
fun
onConnectionStateChanged
(
state
:
Int
,
reason
:
Int
)
{
super
.
onConnectionStateChanged
(
state
,
reason
)
super
.
onConnectionStateChanged
(
state
,
reason
)
// 3 网络连接被服务器中止 该情况现在是因为后端踢人逻辑
// 3 网络连接被服务器中止 该情况现在是因为后端踢人逻辑
Apm
.
reportEvent
(
"agora_android"
,
"rtc_connection_failure"
,
"$state,$reason"
)
if
(
reason
==
3
)
{
if
(
reason
==
3
)
{
callEventSave
(
"50"
,
"通话结束:网络连接被服务器中止 该情况现在是因为后端踢人逻辑,原因(${reason}"
)
callEventSave
(
"50"
,
"通话结束:网络连接被服务器中止 该情况现在是因为后端踢人逻辑,原因(${reason}"
)
writeAgoraLog
(
"通话结束:网络连接被服务器中止 该情况现在是因为后端踢人逻辑,原因(${reason})"
)
writeAgoraLog
(
"通话结束:网络连接被服务器中止 该情况现在是因为后端踢人逻辑,原因(${reason})"
)
...
...
m-audioim/src/main/java/com/ydl/audioim/YDLavManager.kt
View file @
4673e6c2
...
@@ -166,7 +166,7 @@ class YDLavManager {
...
@@ -166,7 +166,7 @@ class YDLavManager {
LogUtil
.
e
(
"[agora]呼叫${response?.calleeId}用户失败:${response?.response}"
)
LogUtil
.
e
(
"[agora]呼叫${response?.calleeId}用户失败:${response?.response}"
)
AliYunRichLogsHelper
.
getInstance
().
sendRichLog
(
AliYunRichLogsHelper
.
getInstance
().
sendRichLog
(
AliYunLogConfig
.
AGORA
,
AliYunLogConfig
.
AGORA
,
"呼叫${response?.calleeId}用户失败:${response?.response}"
"呼叫${response?.calleeId}用户失败:${response?.response}
,${errorCode}
"
)
)
val
dimension
=
hashMapOf
(
val
dimension
=
hashMapOf
(
"call"
to
"call_fail"
,
"call"
to
"call_fail"
,
...
@@ -432,7 +432,7 @@ class YDLavManager {
...
@@ -432,7 +432,7 @@ class YDLavManager {
override
fun
onFailure
(
msg
:
String
?)
{
override
fun
onFailure
(
msg
:
String
?)
{
if
(
msg
!=
"LOGIN_ERR_ALREADY_LOGGED_IN"
)
{
if
(
msg
!=
"LOGIN_ERR_ALREADY_LOGGED_IN"
)
{
Apm
.
report
Custom
(
"agora_login_error"
,
msg
?:
""
,
Exception
(
msg
)
)
Apm
.
report
Event
(
"rtm_android"
,
"connectionstate_error"
,
msg
?:
""
)
}
}
LogUtil
.
e
(
"[agora]实时消息登录失败:$msg"
)
LogUtil
.
e
(
"[agora]实时消息登录失败:$msg"
)
writeAgoraLog
(
writeAgoraLog
(
...
@@ -449,6 +449,7 @@ class YDLavManager {
...
@@ -449,6 +449,7 @@ class YDLavManager {
}
}
})
})
}
else
{
}
else
{
Apm
.
reportEvent
(
"rtm_android"
,
"login_failure"
,
"${it.code},${it.msg}"
)
LogUtil
.
e
(
"声网token获取失败uid:"
+
userId
+
" error:"
+
it
.
msg
)
LogUtil
.
e
(
"声网token获取失败uid:"
+
userId
+
" error:"
+
it
.
msg
)
LogHelper
.
getInstance
()
LogHelper
.
getInstance
()
.
writeLogSync
(
"声网token获取失败uid:"
+
userId
+
" error:"
+
it
.
msg
)
.
writeLogSync
(
"声网token获取失败uid:"
+
userId
+
" error:"
+
it
.
msg
)
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/activity/WatchMessagePictureActivity.java
View file @
4673e6c2
...
@@ -345,12 +345,12 @@ public class WatchMessagePictureActivity extends UI {
...
@@ -345,12 +345,12 @@ public class WatchMessagePictureActivity extends UI {
@Override
@Override
public
void
onFailed
(
int
i
)
{
public
void
onFailed
(
int
i
)
{
Apm
.
INSTANCE
.
report
Custom
(
"yx_attchment_error"
,
""
,
new
Exception
(
String
.
valueOf
(
i
))
);
Apm
.
INSTANCE
.
report
Event
(
"yxim_android"
,
"attchment_error"
,
"云信IM收取消息"
+
i
);
}
}
@Override
@Override
public
void
onException
(
Throwable
throwable
)
{
public
void
onException
(
Throwable
throwable
)
{
Apm
.
INSTANCE
.
report
Custom
(
"yx_attchment_error"
,
""
,
throwable
);
Apm
.
INSTANCE
.
report
Event
(
"yxim_android"
,
"attchment_error"
,
"云信IM收取消息"
+
throwable
.
getMessage
()
);
}
}
});
});
}
}
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/activity/WatchVideoActivity.java
View file @
4673e6c2
...
@@ -509,12 +509,12 @@ public class WatchVideoActivity extends UI implements Callback {
...
@@ -509,12 +509,12 @@ public class WatchVideoActivity extends UI implements Callback {
@Override
@Override
public
void
onFailed
(
int
i
)
{
public
void
onFailed
(
int
i
)
{
Apm
.
INSTANCE
.
report
Custom
(
"yx_attchment_error"
,
""
,
new
Exception
(
String
.
valueOf
(
i
))
);
Apm
.
INSTANCE
.
report
Event
(
"yxim_android"
,
"attchment_error"
,
"云信IM收取消息"
+
i
);
}
}
@Override
@Override
public
void
onException
(
Throwable
throwable
)
{
public
void
onException
(
Throwable
throwable
)
{
Apm
.
INSTANCE
.
report
Custom
(
"yx_attchment_error"
,
""
,
throwable
);
Apm
.
INSTANCE
.
report
Event
(
"yxim_android"
,
"attchment_error"
,
"云信IM收取消息"
+
throwable
.
getMessage
()
);
}
}
});
});
downloading
=
true
;
downloading
=
true
;
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
View file @
4673e6c2
...
@@ -1367,7 +1367,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
...
@@ -1367,7 +1367,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
public
void
onFailed
(
int
code
)
{
public
void
onFailed
(
int
code
)
{
if
(
msg
!=
null
)
{
if
(
msg
!=
null
)
{
sendFailWithBlackList
(
code
,
msg
);
sendFailWithBlackList
(
code
,
msg
);
Apm
.
INSTANCE
.
report
Custom
(
"yx_sendmessage_error"
,
"sessionId:"
+
msg
.
getSessionId
(),
new
Exception
(
String
.
valueOf
(
code
))
);
Apm
.
INSTANCE
.
report
Event
(
"yxim_android"
,
"sendmessage_error"
,
" 云信IM发送消息失败"
+
code
+
msg
);
}
}
}
}
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/module/list/MessageListPanelEx.java
View file @
4673e6c2
...
@@ -849,12 +849,12 @@ public class MessageListPanelEx {
...
@@ -849,12 +849,12 @@ public class MessageListPanelEx {
@Override
@Override
public
void
onFailed
(
int
i
)
{
public
void
onFailed
(
int
i
)
{
Apm
.
INSTANCE
.
report
Custom
(
"yx_attchment_error"
,
""
,
new
Exception
(
String
.
valueOf
(
i
))
);
Apm
.
INSTANCE
.
report
Event
(
"yxim_android"
,
"attchment_error"
,
"云信IM收取消息"
+
i
);
}
}
@Override
@Override
public
void
onException
(
Throwable
throwable
)
{
public
void
onException
(
Throwable
throwable
)
{
Apm
.
INSTANCE
.
report
Custom
(
"yx_attchment_error"
,
""
,
throwable
)
;
Apm
.
INSTANCE
.
report
Event
(
"yxim_android"
,
"attchment_error"
,
"云信IM收取消息"
+
throwable
.
getMessage
());
;
}
}
});
});
}
}
...
@@ -1163,8 +1163,7 @@ public class MessageListPanelEx {
...
@@ -1163,8 +1163,7 @@ public class MessageListPanelEx {
@Override
@Override
public
void
onFailed
(
int
code
)
{
public
void
onFailed
(
int
code
)
{
String
sessionId
=
item
.
getSessionId
();
Apm
.
INSTANCE
.
reportEvent
(
"yxim_android"
,
"revoke_error"
,
"云信IM回撤消息失败"
+
code
);
Apm
.
INSTANCE
.
reportCustom
(
"yx_revoke_error"
,
"sessionId:"
+
sessionId
,
new
Exception
(
String
.
valueOf
(
code
)));
if
(
code
==
ResponseCode
.
RES_OVERDUE
)
{
if
(
code
==
ResponseCode
.
RES_OVERDUE
)
{
ToastHelper
.
showToast
(
container
.
activity
,
R
.
string
.
im_revoke_failed
);
ToastHelper
.
showToast
(
container
.
activity
,
R
.
string
.
im_revoke_failed
);
}
else
{
}
else
{
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/viewholder/MsgViewHolderAudio.java
View file @
4673e6c2
...
@@ -82,12 +82,12 @@ public class MsgViewHolderAudio extends MsgViewHolderBase {
...
@@ -82,12 +82,12 @@ public class MsgViewHolderAudio extends MsgViewHolderBase {
@Override
@Override
public
void
onFailed
(
int
i
)
{
public
void
onFailed
(
int
i
)
{
Apm
.
INSTANCE
.
report
Custom
(
"yx_attchment_error"
,
""
,
new
Exception
(
String
.
valueOf
(
i
))
);
Apm
.
INSTANCE
.
report
Event
(
"yxim_android"
,
"attchment_error"
,
"云信IM收取消息"
+
i
);
}
}
@Override
@Override
public
void
onException
(
Throwable
throwable
)
{
public
void
onException
(
Throwable
throwable
)
{
Apm
.
INSTANCE
.
report
Custom
(
"yx_attchment_error"
,
""
,
throwable
);
Apm
.
INSTANCE
.
report
Event
(
"yxim_android"
,
"attchment_error"
,
"云信IM收取消息"
+
throwable
.
getMessage
()
);
}
}
});
});
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/viewholder/MsgViewHolderBase.java
View file @
4673e6c2
...
@@ -151,12 +151,12 @@ public abstract class MsgViewHolderBase extends RecyclerViewHolder<BaseMultiItem
...
@@ -151,12 +151,12 @@ public abstract class MsgViewHolderBase extends RecyclerViewHolder<BaseMultiItem
@Override
@Override
public
void
onFailed
(
int
i
)
{
public
void
onFailed
(
int
i
)
{
Apm
.
INSTANCE
.
report
Custom
(
"yx_attchment_error"
,
""
,
new
Exception
(
String
.
valueOf
(
i
))
);
Apm
.
INSTANCE
.
report
Event
(
"yxim_android"
,
"attchment_error"
,
"云信IM收取消息"
+
i
);
}
}
@Override
@Override
public
void
onException
(
Throwable
throwable
)
{
public
void
onException
(
Throwable
throwable
)
{
Apm
.
INSTANCE
.
report
Custom
(
"yx_attchment_error"
,
""
,
throwable
);
Apm
.
INSTANCE
.
report
Event
(
"yxim_android"
,
"attchment_error"
,
"云信IM收取消息"
+
throwable
.
getMessage
()
);
}
}
});
});
}
}
...
...
m-user/src/main/java/com/yidianling/user/rxlogin/LoginObservable.kt
View file @
4673e6c2
...
@@ -73,7 +73,7 @@ class LoginObservable(val activity: Activity, private val media: SHARE_MEDIA): O
...
@@ -73,7 +73,7 @@ class LoginObservable(val activity: Activity, private val media: SHARE_MEDIA): O
}
}
override
fun
onError
(
p0
:
SHARE_MEDIA
?,
p1
:
Int
,
p2
:
Throwable
?)
{
override
fun
onError
(
p0
:
SHARE_MEDIA
?,
p1
:
Int
,
p2
:
Throwable
?)
{
Apm
.
report
Custom
(
"login"
,
"third_auth_error"
,
p2
?:
Exception
(
"${p0},$p1"
)
)
Apm
.
report
Event
(
"login_android"
,
"third_auth_error"
,
"三方授权失败${p2?.message ?: p1}"
)
observer
?.
onError
(
p2
?:
Throwable
(
"未知异常"
))
observer
?.
onError
(
p2
?:
Throwable
(
"未知异常"
))
}
}
...
...
m-user/src/main/java/com/yidianling/user/ui/login/OneKeyLoginHelp.kt
View file @
4673e6c2
...
@@ -507,7 +507,7 @@ object OneKeyLoginHelp {
...
@@ -507,7 +507,7 @@ object OneKeyLoginHelp {
"一键登录失败 msg:${it.msg}"
"一键登录失败 msg:${it.msg}"
)
)
ToastUtil
.
toastShort
(
it
.
msg
)
ToastUtil
.
toastShort
(
it
.
msg
)
Apm
.
report
Custom
(
"login"
,
"oneKey_error"
,
Exception
(
"${it.code},${it.msg}"
)
)
Apm
.
report
Event
(
"login_android"
,
"oneKey_error"
,
"一键登录失败报错${it.code},${it.msg}"
)
mPhoneNumberAuthHelper
?.
hideLoginLoading
()
mPhoneNumberAuthHelper
?.
hideLoginLoading
()
}
}
},
{
},
{
...
@@ -515,7 +515,7 @@ object OneKeyLoginHelp {
...
@@ -515,7 +515,7 @@ object OneKeyLoginHelp {
AliYunLogConfig
.
LOGIN
,
AliYunLogConfig
.
LOGIN
,
"一键登录Error msg:${it.message}"
"一键登录Error msg:${it.message}"
)
)
Apm
.
report
Custom
(
"login"
,
"oneKey_error"
,
it
)
Apm
.
report
Event
(
"login_android"
,
"oneKey_error"
,
"一键登录失败报错${it.message}"
)
ToastUtil
.
toastShort
(
it
.
message
)
ToastUtil
.
toastShort
(
it
.
message
)
mPhoneNumberAuthHelper
?.
hideLoginLoading
()
mPhoneNumberAuthHelper
?.
hideLoginLoading
()
})
})
...
@@ -527,7 +527,7 @@ object OneKeyLoginHelp {
...
@@ -527,7 +527,7 @@ object OneKeyLoginHelp {
}
}
override
fun
onTokenFailed
(
s
:
String
)
{
override
fun
onTokenFailed
(
s
:
String
)
{
Apm
.
report
Custom
(
"login"
,
"oneKey_error"
,
Exception
(
"TokenFailed:${s}"
)
)
Apm
.
report
Event
(
"login_android"
,
"oneKey_error"
,
"一键登录失败TokenFailed:${s}"
)
LogUtil
.
e
(
"onTokenFailed"
+
s
)
LogUtil
.
e
(
"onTokenFailed"
+
s
)
mIsGetTokenSuccess
=
false
mIsGetTokenSuccess
=
false
val
tokenRet
=
TokenRet
.
fromJson
(
s
)
val
tokenRet
=
TokenRet
.
fromJson
(
s
)
...
...
m-user/src/main/java/com/yidianling/user/ui/login/presenter/InputPassWordPresenterImpl.kt
View file @
4673e6c2
...
@@ -115,12 +115,12 @@ class InputPassWordPresenterImpl :
...
@@ -115,12 +115,12 @@ class InputPassWordPresenterImpl :
AliYunRichLogsHelper
.
getInstance
()
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
LOGIN
,
"手机号密码 登录失败 msg: ${it.msg}"
)
.
sendRichLog
(
AliYunLogConfig
.
LOGIN
,
"手机号密码 登录失败 msg: ${it.msg}"
)
ToastUtil
.
toastShort
(
it
.
msg
)
ToastUtil
.
toastShort
(
it
.
msg
)
Apm
.
report
Custom
(
"login"
,
"password_error"
,
Exception
(
"密码登录失败,$phoneCountryCode-$phone"
)
)
Apm
.
report
Event
(
"login_android"
,
"password_error"
,
"密码登录失败,$phoneCountryCode-$phone"
)
mView
.
startAnim
()
mView
.
startAnim
()
}
else
{
}
else
{
if
(
it
.
data
.
userInfo
?.
user_type
==
2
)
{
if
(
it
.
data
.
userInfo
?.
user_type
==
2
)
{
mView
.
showNormalDialog
()
mView
.
showNormalDialog
()
Apm
.
report
Custom
(
"login"
,
"isexpert"
,
Exception
(
"登录—专家帐号,$phoneCountryCode-$phone"
)
)
Apm
.
report
Event
(
"login_android"
,
"isexpert"
,
"登录—专家帐号,$phoneCountryCode-$phone"
)
}
else
{
}
else
{
saveUserData
(
it
.
data
)
saveUserData
(
it
.
data
)
if
(
it
.
data
.
firstLogin
==
1
)
{
//第一次登录:是注册
if
(
it
.
data
.
firstLogin
==
1
)
{
//第一次登录:是注册
...
@@ -140,7 +140,7 @@ class InputPassWordPresenterImpl :
...
@@ -140,7 +140,7 @@ class InputPassWordPresenterImpl :
}
}
},
{
},
{
YdlCommonOut
.
showToast
(
it
.
message
!!
)
YdlCommonOut
.
showToast
(
it
.
message
!!
)
Apm
.
report
Custom
(
"login"
,
"password_error"
,
it
)
Apm
.
report
Event
(
"login_android"
,
"password_error"
,
"密码登录失败${it.message}"
)
AliYunRichLogsHelper
.
getInstance
()
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
LOGIN
,
"手机号密码 Error msg: ${it.message}"
)
.
sendRichLog
(
AliYunLogConfig
.
LOGIN
,
"手机号密码 Error msg: ${it.message}"
)
...
...
m-user/src/main/java/com/yidianling/user/ui/login/presenter/LoginPresenterImpl.kt
View file @
4673e6c2
...
@@ -168,7 +168,7 @@ class LoginPresenterImpl(view: ILoginContract.View) :
...
@@ -168,7 +168,7 @@ class LoginPresenterImpl(view: ILoginContract.View) :
if
(
it
.
data
.
isRegistered
==
1
)
{
if
(
it
.
data
.
isRegistered
==
1
)
{
mView
.
showLoading
(
false
)
mView
.
showLoading
(
false
)
mView
.
showHasBindedDialog
()
mView
.
showHasBindedDialog
()
Apm
.
report
Custom
(
"login"
,
"mobile_isbind"
,
Exception
(
"登录-手机被绑定,$countryCode-$phone"
)
)
Apm
.
report
Event
(
"login_android"
,
"mobile_isbind"
,
"登录-手机被绑定,$countryCode-$phone"
)
}
else
{
}
else
{
mView
.
checkPhoneStatusSuccess
(
it
.
data
,
phone
)
mView
.
checkPhoneStatusSuccess
(
it
.
data
,
phone
)
}
}
...
@@ -176,7 +176,7 @@ class LoginPresenterImpl(view: ILoginContract.View) :
...
@@ -176,7 +176,7 @@ class LoginPresenterImpl(view: ILoginContract.View) :
if
(
it
.
data
.
isDoctor
==
1
)
{
//是专家账号
if
(
it
.
data
.
isDoctor
==
1
)
{
//是专家账号
mView
.
showLoading
(
false
)
mView
.
showLoading
(
false
)
mView
.
showNormalDialog
()
mView
.
showNormalDialog
()
Apm
.
report
Custom
(
"login"
,
"isexpert"
,
Exception
(
"登录—专家帐号,$countryCode-$phone"
)
)
Apm
.
report
Event
(
"login_android"
,
"isexpert"
,
"登录—专家帐号,$countryCode-$phone"
)
}
else
{
}
else
{
mView
.
checkPhoneStatusSuccess
(
it
.
data
,
phone
)
mView
.
checkPhoneStatusSuccess
(
it
.
data
,
phone
)
}
}
...
@@ -214,7 +214,7 @@ class LoginPresenterImpl(view: ILoginContract.View) :
...
@@ -214,7 +214,7 @@ class LoginPresenterImpl(view: ILoginContract.View) :
.
subscribe
({
.
subscribe
({
mView
.
dismissProgressView
()
mView
.
dismissProgressView
()
if
(
it
?.
data
==
null
)
{
if
(
it
?.
data
==
null
)
{
Apm
.
report
Custom
(
"login"
,
"third_login_error"
,
Exception
(
"${it.code},${it.msg}"
)
)
Apm
.
report
Event
(
"login_android"
,
"third_login_error"
,
"三方登录失败${it.code},${it.msg}"
)
ToastUtil
.
toastShort
(
it
.
msg
)
ToastUtil
.
toastShort
(
it
.
msg
)
return
@subscribe
return
@subscribe
}
}
...
@@ -268,7 +268,7 @@ class LoginPresenterImpl(view: ILoginContract.View) :
...
@@ -268,7 +268,7 @@ class LoginPresenterImpl(view: ILoginContract.View) :
},
{
},
{
mView
.
dismissProgressView
()
mView
.
dismissProgressView
()
Apm
.
report
Custom
(
"login"
,
"third_login_error"
,
it
)
Apm
.
report
Event
(
"login"
,
"third_login_error"
,
it
.
message
?:
""
)
YdlCommonOut
.
showToast
(
it
.
message
!!
)
YdlCommonOut
.
showToast
(
it
.
message
!!
)
AliYunRichLogsHelper
.
getInstance
()
AliYunRichLogsHelper
.
getInstance
()
.
sendRichLog
(
AliYunLogConfig
.
LOGIN
,
media
.
getName
()
+
"登录失败"
)
.
sendRichLog
(
AliYunLogConfig
.
LOGIN
,
media
.
getName
()
+
"登录失败"
)
...
...
m-user/src/main/java/com/yidianling/user/ui/login/presenter/VerificationCodePresenterImpl.kt
View file @
4673e6c2
...
@@ -47,12 +47,12 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base
...
@@ -47,12 +47,12 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base
mView
.
startCountdown
(
60
)
mView
.
startCountdown
(
60
)
}
else
{
}
else
{
mView
.
startAnim
()
mView
.
startAnim
()
Apm
.
report
Custom
(
"login"
,
"getcode_error"
,
Exception
(
"${phone},${it.code},${it.msg}"
)
)
Apm
.
report
Event
(
"login_android"
,
"getcode_error"
,
"获取验证码失败${phone},${it.code},${it.msg}"
)
ToastUtil
.
toastShort
(
it
.
msg
)
ToastUtil
.
toastShort
(
it
.
msg
)
}
}
},
{
},
{
mView
.
startAnim
()
mView
.
startAnim
()
Apm
.
report
Custom
(
"login"
,
"getcode_error"
,
it
)
Apm
.
report
Event
(
"login"
,
"getcode_error"
,
"获取验证码失败${it.message}"
)
ToastUtil
.
toastShort
(
it
.
message
)
ToastUtil
.
toastShort
(
it
.
message
)
})
})
}
}
...
@@ -115,13 +115,13 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base
...
@@ -115,13 +115,13 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base
}
else
{
}
else
{
ToastUtil
.
toastShort
(
it
.
msg
)
//服务端返回{验证码错误&异常}信息
ToastUtil
.
toastShort
(
it
.
msg
)
//服务端返回{验证码错误&异常}信息
// mView.startAnim()
// mView.startAnim()
Apm
.
report
Custom
(
"login"
,
"bind_mobile_error"
,
Exception
(
"${param.countryCode}-${param.phoneNumber},${it.code},${it.msg}"
)
)
Apm
.
report
Event
(
"login_android"
,
"bind_mobile_error"
,
" 手机号绑定失败${param.countryCode}-${param.phoneNumber},${it.code},${it.msg}"
)
mView
.
verificationErrorCode
()
mView
.
verificationErrorCode
()
}
}
},
{
},
{
// mView.startAnim()
// mView.startAnim()
mView
.
verificationErrorCode
()
mView
.
verificationErrorCode
()
Apm
.
report
Custom
(
"login"
,
"bind_mobile_error"
,
it
)
Apm
.
report
Event
(
"login_android"
,
"bind_mobile_error"
,
" 手机号绑定失败${param.countryCode}-${param.phoneNumber},${it.message}"
)
ToastUtil
.
toastShort
(
it
.
message
)
ToastUtil
.
toastShort
(
it
.
message
)
})
})
...
@@ -193,12 +193,12 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base
...
@@ -193,12 +193,12 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base
}
else
{
}
else
{
ToastUtil
.
toastShort
(
it
.
msg
)
//服务端返回{验证码错误&异常}信息
ToastUtil
.
toastShort
(
it
.
msg
)
//服务端返回{验证码错误&异常}信息
// mView.startAnim()
// mView.startAnim()
Apm
.
report
Custom
(
"login"
,
"code_error"
,
Exception
(
"${phoneCountryCode}-${phone},${it.code},${it.msg}"
)
)
Apm
.
report
Event
(
"login_android"
,
"code_error"
,
"验证码登录失败${phoneCountryCode}-${phone},${it.code},${it.msg}"
)
mView
.
verificationErrorCode
()
mView
.
verificationErrorCode
()
}
}
},
{
},
{
mView
.
startAnim
()
mView
.
startAnim
()
Apm
.
report
Custom
(
"login"
,
"code_error"
,
it
)
Apm
.
report
Event
(
"login"
,
"code_error"
,
it
.
message
?:
""
)
ToastUtil
.
toastShort
(
it
.
message
)
ToastUtil
.
toastShort
(
it
.
message
)
})
})
}
}
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/app/ApmInit.kt
View file @
4673e6c2
...
@@ -4,9 +4,11 @@ import android.content.Context
...
@@ -4,9 +4,11 @@ import android.content.Context
import
com.apm.insight.MonitorCrash
import
com.apm.insight.MonitorCrash
import
com.apm.insight.log.VLog
import
com.apm.insight.log.VLog
import
com.bytedance.apm.insight.ApmInsight
import
com.bytedance.apm.insight.ApmInsight
import
com.bytedance.apm.insight.ApmInsightAgent
import
com.bytedance.apm.insight.ApmInsightInitConfig
import
com.bytedance.apm.insight.ApmInsightInitConfig
import
com.bytedance.apm.insight.IDynamicParams
import
com.bytedance.apm.insight.IDynamicParams
import
com.meituan.android.walle.WalleChannelReader
import
com.meituan.android.walle.WalleChannelReader
import
org.json.JSONObject
object
Apm
{
object
Apm
{
...
@@ -46,6 +48,33 @@ object Apm {
...
@@ -46,6 +48,33 @@ object Apm {
crash
?.
reportCustomErr
(
msg
,
type
,
throwable
)
crash
?.
reportCustomErr
(
msg
,
type
,
throwable
)
}
}
}
}
fun
reportEvent
(
event
:
String
,
dimension
:
String
,
value
:
String
)
{
try
{
if
(
hasInit
)
{
val
d
=
hashMapOf
(
dimension
to
value
)
ApmInsightAgent
.
monitorEvent
(
event
,
d
,
hashMapOf
())
}
}
catch
(
throwable
:
Throwable
)
{
VLog
.
e
(
"reportEvent"
,
throwable
.
message
)
}
}
fun
reportEventWithExt
(
event
:
String
,
dimension
:
String
,
value
:
String
,
ext
:
Map
<
String
,
String
>)
{
try
{
if
(
hasInit
)
{
val
d
=
hashMapOf
(
dimension
to
value
)
if
(
ext
.
isNotEmpty
())
{
val
json
=
JSONObject
(
ext
)
ApmInsightAgent
.
monitorEvent
(
event
,
d
,
hashMapOf
(),
json
)
}
else
{
ApmInsightAgent
.
monitorEvent
(
event
,
d
,
hashMapOf
())
}
}
}
catch
(
throwable
:
Throwable
)
{
VLog
.
e
(
"reportEvent"
,
throwable
.
message
)
}
}
}
}
private
class
ApmParams
(
val
crash
:
MonitorCrash
?,
val
uidCall
:
()
->
String
?)
:
IDynamicParams
()
{
private
class
ApmParams
(
val
crash
:
MonitorCrash
?,
val
uidCall
:
()
->
String
?)
:
IDynamicParams
()
{
...
...
ydl-platform/src/main/java/com/ydl/ydlcommon/base/config/HttpConfig.kt
View file @
4673e6c2
...
@@ -194,16 +194,16 @@ class HttpConfig {
...
@@ -194,16 +194,16 @@ class HttpConfig {
val
message
=
resp
.
message
()
val
message
=
resp
.
message
()
val
api
=
req
.
url
().
encodedPath
()
val
api
=
req
.
url
().
encodedPath
()
if
(!
resp
.
isSuccessful
)
{
if
(!
resp
.
isSuccessful
)
{
Apm
.
report
Custom
(
"network_request_error"
,
"${api}(${code},${message})"
,
Exception
(
"${api}(${code},${message})"
))
Apm
.
report
EventWithExt
(
"network_api"
,
"resp_fail"
,
api
,
mapOf
(
"code"
to
code
.
toString
(),
"msg"
to
message
))
}
else
{
}
else
{
try
{
try
{
val
body
=
resp
.
body
()
?:
return
@Interceptor
resp
val
body
=
resp
.
body
()
?:
return
@Interceptor
resp
val
buffer
=
body
.
source
().
buffer
()
val
buffer
=
body
.
source
().
buffer
()
if
(!
isPlaintext
(
buffer
))
return
@Interceptor
resp
if
(!
isPlaintext
(
buffer
))
return
@Interceptor
resp
val
readString
=
buffer
.
clone
().
readString
(
Charset
.
forName
(
"UTF-8"
))
val
readString
=
buffer
.
clone
().
readString
(
Charset
.
forName
(
"UTF-8"
))
val
fromJson
=
Gson
().
fromJson
<
BaseAPIResponse
<
Any
>>(
readString
,
BaseAPIResponse
::
class
.
java
)
val
fromJson
=
Gson
().
fromJson
<
BaseAPIResponse
<
Any
>>(
readString
,
BaseAPIResponse
::
class
.
java
)
if
(
fromJson
.
code
!=
"200"
&&
fromJson
.
code
!=
"0"
)
{
if
(
fromJson
.
code
!=
"200"
&&
fromJson
.
code
!=
"0"
)
{
Apm
.
report
Custom
(
"network_business_error"
,
"${api}(${fromJson.code},${fromJson.msg})"
,
Exception
(
"${api}(${fromJson.code},${fromJson.msg})"
))
Apm
.
report
EventWithExt
(
"network_api"
,
"business_fail"
,
api
,
mapOf
(
"code"
to
code
.
toString
(),
"msg"
to
message
))
}
}
}
catch
(
throwable
:
Throwable
)
{
}
catch
(
throwable
:
Throwable
)
{
LogUtil
.
e
(
throwable
.
message
)
LogUtil
.
e
(
throwable
.
message
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment