Commit a9ff09f1 by 刘鹏

feat: 登录模块日志

parent 68c46651
...@@ -8,7 +8,7 @@ ext { ...@@ -8,7 +8,7 @@ ext {
"m-confide" : "0.0.49.02", "m-confide" : "0.0.49.02",
"m-consultant" : "0.0.59.66", "m-consultant" : "0.0.59.66",
"m-fm" : "0.0.30.01", "m-fm" : "0.0.30.01",
"m-user" : "0.0.61.18", "m-user" : "0.0.61.23",
"m-home" : "0.0.22.55", "m-home" : "0.0.22.55",
"m-im" : "0.0.18.45", "m-im" : "0.0.18.45",
"m-dynamic" : "0.0.7.19", "m-dynamic" : "0.0.7.19",
...@@ -91,7 +91,7 @@ ext { ...@@ -91,7 +91,7 @@ ext {
"m-confide" : "0.0.49.02", "m-confide" : "0.0.49.02",
"m-consultant" : "0.0.59.66", "m-consultant" : "0.0.59.66",
"m-fm" : "0.0.30.01", "m-fm" : "0.0.30.01",
"m-user" : "0.0.61.18", "m-user" : "0.0.61.23",
"m-home" : "0.0.22.54", "m-home" : "0.0.22.54",
"m-im" : "0.0.18.45", "m-im" : "0.0.18.45",
"m-dynamic" : "0.0.7.19", "m-dynamic" : "0.0.7.19",
......
...@@ -6,6 +6,8 @@ import com.tencent.bugly.crashreport.CrashReport ...@@ -6,6 +6,8 @@ import com.tencent.bugly.crashreport.CrashReport
import com.ydl.ydlcommon.data.http.RxUtils import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.utils.ActivityManager import com.ydl.ydlcommon.utils.ActivityManager
import com.ydl.ydlcommon.utils.BuryPointUtils import com.ydl.ydlcommon.utils.BuryPointUtils
import com.ydl.ydlnet.utils.log.AliYunLogConfig
import com.ydl.ydlnet.utils.log.AliYunLogHelper
import com.yidianling.common.tools.LogUtil import com.yidianling.common.tools.LogUtil
import com.yidianling.im.api.bean.IMLoginInfo import com.yidianling.im.api.bean.IMLoginInfo
import com.yidianling.im.api.bean.IMRequestCallback import com.yidianling.im.api.bean.IMRequestCallback
...@@ -57,16 +59,22 @@ object LoginUtils { ...@@ -57,16 +59,22 @@ object LoginUtils {
val info = IMLoginInfo(userInfo?.uid ?: "", userInfo?.hxpwd ?: "") val info = IMLoginInfo(userInfo?.uid ?: "", userInfo?.hxpwd ?: "")
val callback = object : IMRequestCallback<IMLoginInfo> { val callback = object : IMRequestCallback<IMLoginInfo> {
override fun onSuccess(t: IMLoginInfo?) { override fun onSuccess(t: IMLoginInfo?) {
LogUtil.e("IM登录成功:"+"info.account:"+info.account+"info.passWord"+info.passWord) LogUtil.e("IM登录成功:" + "info.account:" + info.account + "info.passWord" + info.passWord)
UserIn.imSetAccount(userInfo?.uid ?: "") UserIn.imSetAccount(userInfo?.uid ?: "")
AliYunLogHelper.getInstance().sendLog(AliYunLogConfig.LOGIN, "IM登录成功")
} }
override fun onFailed(i: Int) { override fun onFailed(i: Int) {
LogUtil.e("IM登录失败:$i"+"info.account:"+info.account+"info.passWord"+info.passWord) LogUtil.e("IM登录失败:$i" + "info.account:" + info.account + "info.passWord" + info.passWord)
AliYunLogHelper.getInstance().sendLog(AliYunLogConfig.LOGIN, "IM登录失败")
} }
override fun onException(throwable: Throwable?) { override fun onException(throwable: Throwable?) {
LogUtil.e("IM登录onException:${throwable?.message}") LogUtil.e("IM登录onException:${throwable?.message}")
AliYunLogHelper.getInstance()
.sendLog(AliYunLogConfig.LOGIN, "IM登录onException:${throwable?.message}")
} }
} }
...@@ -79,17 +87,18 @@ object LoginUtils { ...@@ -79,17 +87,18 @@ object LoginUtils {
fun logout() { fun logout() {
EventBus.getDefault().post(UserLogoutEvent()) EventBus.getDefault().post(UserLogoutEvent())
UserHttpImpl.getInstance().logout(Logout()) UserHttpImpl.getInstance().logout(Logout())
.compose(RxUtils.resultData()) .compose(RxUtils.resultData())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe({ .subscribe({
logoutClearLocal() logoutClearLocal()
}, { }, {
logoutClearLocal() logoutClearLocal()
}) })
} }
@JvmStatic @JvmStatic
fun logoutClearLocal() { fun logoutClearLocal() {
AliYunLogHelper.getInstance().sendLog(AliYunLogConfig.LOGIN, "退出登录")
UserIn.imLogout() UserIn.imLogout()
UserIn.closePlayer() UserIn.closePlayer()
UserIn.clearImData() UserIn.clearImData()
...@@ -105,7 +114,7 @@ object LoginUtils { ...@@ -105,7 +114,7 @@ object LoginUtils {
ActivityManager.finishAll() ActivityManager.finishAll()
if (StatusUtils.isFirstLogin && StatusUtils.isFirstStartApp) { if (StatusUtils.isFirstLogin && StatusUtils.isFirstStartApp) {
activity.startActivity(Intent(activity, CollectSexAndBirthActivity::class.java)) activity.startActivity(Intent(activity, CollectSexAndBirthActivity::class.java))
}else { } else {
UserIn.mainIntent(activity) UserIn.mainIntent(activity)
} }
} else {//需要判断stack中是否有MainActivity } else {//需要判断stack中是否有MainActivity
......
...@@ -15,6 +15,8 @@ import com.ydl.ydlcommon.utils.ActivityManager ...@@ -15,6 +15,8 @@ import com.ydl.ydlcommon.utils.ActivityManager
import com.ydl.ydlcommon.utils.UserInfoCache import com.ydl.ydlcommon.utils.UserInfoCache
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.remind.ToastHelper import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.ydl.ydlnet.utils.log.AliYunLogConfig
import com.ydl.ydlnet.utils.log.AliYunLogHelper
import com.yidianling.im.api.bean.IMLoginInfo import com.yidianling.im.api.bean.IMLoginInfo
import com.yidianling.im.api.bean.IMRequestCallback import com.yidianling.im.api.bean.IMRequestCallback
import com.yidianling.user.LoginUtils import com.yidianling.user.LoginUtils
...@@ -118,13 +120,13 @@ class SmsLoginActivity : BaseActivity() { ...@@ -118,13 +120,13 @@ class SmsLoginActivity : BaseActivity() {
})*/ })*/
vCodeSub = userHttp.code(CodeParam(code, phoneNum, UserConstants.SIGNIN_ACTION)) vCodeSub = userHttp.code(CodeParam(code, phoneNum, UserConstants.SIGNIN_ACTION))
.compose(RxUtils.resultData()) .compose(RxUtils.resultData())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {}, object : ThrowableConsumer() { .subscribe(Consumer {}, object : ThrowableConsumer() {
override fun accept(msg: String) { override fun accept(msg: String) {
ToastHelper.show(msg) ToastHelper.show(msg)
} }
}) })
} }
private var loginSub: Disposable? = null private var loginSub: Disposable? = null
...@@ -136,37 +138,49 @@ class SmsLoginActivity : BaseActivity() { ...@@ -136,37 +138,49 @@ class SmsLoginActivity : BaseActivity() {
return return
} }
ActionCountUtils.count(UserBIConstants.POSITION_LOGIN_CLICK, UserBIConstants.ACTION_TYPE_CODE_LOGIN) ActionCountUtils.count(
UserBIConstants.POSITION_LOGIN_CLICK,
UserBIConstants.ACTION_TYPE_CODE_LOGIN
)
Log.e("短信验证码:", code + " - " + phoneNum + " - " + et_code.text.toString()); Log.e("短信验证码:", code + " - " + phoneNum + " - " + et_code.text.toString());
loginSub = userHttp.login(LoginParam(code, phoneNum, null, 2, et_code.text.toString())) loginSub = userHttp.login(LoginParam(code, phoneNum, null, 2, et_code.text.toString()))
.compose(RxUtils.resultData()) .compose(RxUtils.resultData())
.doOnNext { LoginUtils.saveData(it) } .doOnNext { LoginUtils.saveData(it) }
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.doOnSubscribe { showProgressDialog("") } .doOnSubscribe { showProgressDialog("") }
.doAfterTerminate { dismissProgressDialog() } .doAfterTerminate { dismissProgressDialog() }
.subscribe(Consumer { .subscribe(Consumer {
LoginUtils.onLogin(it) LoginUtils.onLogin(it)
//关闭手势解锁页面与指纹解锁页面 //关闭手势解锁页面与指纹解锁页面
finishFinger() finishFinger()
if (it.firstLogin == 1) { if (it.firstLogin == 1) {
StatusUtils.isFirstLogin = true StatusUtils.isFirstLogin = true
baiduActionBury() baiduActionBury()
}else { } else {
ActionCountUtils.countUid(UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK,it.uid!!,UserBIConstants.ACTION_TYPE_CODE_LOGIN) ActionCountUtils.countUid(
} UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK,
it.uid!!,
UserBIConstants.ACTION_TYPE_CODE_LOGIN
)
}
// ActivityManager.finishActivity(LoginActivity::class.java) // ActivityManager.finishActivity(LoginActivity::class.java)
// if (ActivityManager.getActivitySize() <= 1) { // if (ActivityManager.getActivitySize() <= 1) {
// UserIn.mainIntent(this) // UserIn.mainIntent(this)
// } // }
// finish() // finish()
LoginUtils.loginSuccessOperate(this) LoginUtils.loginSuccessOperate(this)
}, object : ThrowableConsumer() {
override fun accept(msg: String) { AliYunLogHelper.getInstance()
dismissProgressDialog() .sendLog(AliYunLogConfig.LOGIN, "短信验证码 成功")
YdlCommonOut.showToast(msg) }, object : ThrowableConsumer() {
} override fun accept(msg: String) {
}) dismissProgressDialog()
YdlCommonOut.showToast(msg)
AliYunLogHelper.getInstance()
.sendLog(AliYunLogConfig.LOGIN, "短信验证码 失败 msg:$msg ")
}
})
} }
/** /**
...@@ -224,9 +238,11 @@ class SmsLoginActivity : BaseActivity() { ...@@ -224,9 +238,11 @@ class SmsLoginActivity : BaseActivity() {
try { try {
if (userInfo != null) { if (userInfo != null) {
UserIn.imSetAccount(userInfo.uid.toString()) UserIn.imSetAccount(userInfo.uid.toString())
UserInfoCache.getInstance().saveYDLUser(userInfo.uid.toString(), UserInfoCache.getInstance().saveYDLUser(
userInfo.nick_name, userInfo.uid.toString(),
userInfo.head) userInfo.nick_name,
userInfo.head
)
} }
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()
...@@ -237,21 +253,21 @@ class SmsLoginActivity : BaseActivity() { ...@@ -237,21 +253,21 @@ class SmsLoginActivity : BaseActivity() {
private fun initTimer() { private fun initTimer() {
timerSub = Observable.interval(0, 1, TimeUnit.SECONDS) timerSub = Observable.interval(0, 1, TimeUnit.SECONDS)
.subscribeOn(Schedulers.computation()) .subscribeOn(Schedulers.computation())
.take(60) .take(60)
.map { String.format("重发(%d)", 59 - it) } .map { String.format("重发(%d)", 59 - it) }
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.doOnSubscribe { .doOnSubscribe {
tv_get_code.isEnabled = false tv_get_code.isEnabled = false
tv_get_code.setTextColor(-0x525253) tv_get_code.setTextColor(-0x525253)
} }
.subscribe({ .subscribe({
tv_get_code.text = it tv_get_code.text = it
}, {}, { }, {}, {
tv_get_code.text = "重新发送" tv_get_code.text = "重新发送"
tv_get_code.isEnabled = true tv_get_code.isEnabled = true
tv_get_code.setTextColor(-0xb62d7f) tv_get_code.setTextColor(-0xb62d7f)
}) })
} }
......
...@@ -7,7 +7,6 @@ import android.content.Context ...@@ -7,7 +7,6 @@ import android.content.Context
import android.content.pm.ActivityInfo import android.content.pm.ActivityInfo
import android.graphics.Color import android.graphics.Color
import android.text.TextUtils import android.text.TextUtils
import android.util.Log
import android.util.TypedValue import android.util.TypedValue
import android.view.Gravity import android.view.Gravity
import android.view.View import android.view.View
...@@ -17,7 +16,6 @@ import android.widget.TextView ...@@ -17,7 +16,6 @@ import android.widget.TextView
import com.fm.openinstall.OpenInstall import com.fm.openinstall.OpenInstall
import com.fm.openinstall.listener.AppInstallAdapter import com.fm.openinstall.listener.AppInstallAdapter
import com.fm.openinstall.model.AppData import com.fm.openinstall.model.AppData
import com.fm.openinstall.model.Error
import com.meituan.android.walle.WalleChannelReader import com.meituan.android.walle.WalleChannelReader
import com.mobile.auth.gatewayauth.* import com.mobile.auth.gatewayauth.*
import com.mobile.auth.gatewayauth.model.TokenRet import com.mobile.auth.gatewayauth.model.TokenRet
...@@ -29,6 +27,8 @@ import com.ydl.ydlcommon.utils.LogUtil ...@@ -29,6 +27,8 @@ import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.YDLCacheUtils import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.log.LogHelper import com.ydl.ydlcommon.utils.log.LogHelper
import com.ydl.ydlnet.utils.log.AliYunLogConfig
import com.ydl.ydlnet.utils.log.AliYunLogHelper
import com.yidianling.common.tools.RxAppTool import com.yidianling.common.tools.RxAppTool
import com.yidianling.common.tools.RxDeviceTool import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool import com.yidianling.common.tools.RxImageTool
...@@ -430,6 +430,7 @@ object OneKeyLoginHelp { ...@@ -430,6 +430,7 @@ object OneKeyLoginHelp {
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe({ .subscribe({
if (it.code == 200) { if (it.code == 200) {
AliYunLogHelper.getInstance().sendLog(AliYunLogConfig.LOGIN,"一键登录成功")
ToastUtil.toastShort("登录成功") ToastUtil.toastShort("登录成功")
saveUserData(it.data) saveUserData(it.data)
if (it.data.firstLogin == 1) {//第一次登录:是注册 if (it.data.firstLogin == 1) {//第一次登录:是注册
...@@ -463,10 +464,12 @@ object OneKeyLoginHelp { ...@@ -463,10 +464,12 @@ object OneKeyLoginHelp {
LoginUtils.loginSuccessOperate(mActivity) LoginUtils.loginSuccessOperate(mActivity)
} }
} else { } else {
AliYunLogHelper.getInstance().sendLog(AliYunLogConfig.LOGIN,"一键登录失败 msg:${it.msg}")
ToastUtil.toastShort(it.msg) ToastUtil.toastShort(it.msg)
mPhoneNumberAuthHelper?.hideLoginLoading() mPhoneNumberAuthHelper?.hideLoginLoading()
} }
}, { }, {
AliYunLogHelper.getInstance().sendLog(AliYunLogConfig.LOGIN,"一键登录Error msg:${it.message}")
ToastUtil.toastShort(it.message) ToastUtil.toastShort(it.message)
mPhoneNumberAuthHelper?.hideLoginLoading() mPhoneNumberAuthHelper?.hideLoginLoading()
}) })
...@@ -580,23 +583,30 @@ object OneKeyLoginHelp { ...@@ -580,23 +583,30 @@ object OneKeyLoginHelp {
* */ * */
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
fun startLogin(context: Activity, isOpenDialog: Boolean) { fun startLogin(context: Activity, isOpenDialog: Boolean) {
RxPermissions(context) try {
.request(Manifest.permission.READ_PHONE_STATE) RxPermissions(context)
.subscribe { hasPermission: Boolean? -> .request(Manifest.permission.READ_PHONE_STATE)
if (hasPermission == true && mIsOpenOneKeyLogin) { .subscribe { hasPermission: Boolean? ->
getLoginToken(isOpenDialog) if (hasPermission == true && mIsOpenOneKeyLogin) {
} else { getLoginToken(isOpenDialog)
// 一键登录页面打开成功
if (mOpenPageIsSuccess) {
RegisterAndLoginActivity.start(context)
} else { } else {
RegisterAndLoginActivity.start( // 一键登录页面打开成功
context, if (mOpenPageIsSuccess) {
isFromOneKey = false, RegisterAndLoginActivity.start(context)
isFromGuide = true } else {
) RegisterAndLoginActivity.start(
context,
isFromOneKey = false,
isFromGuide = true
)
}
} }
} }
} } catch (e: Exception) {
e.printStackTrace()
} finally {
RegisterAndLoginActivity.start(context)
}
} }
} }
...@@ -34,6 +34,8 @@ import com.ydl.ydlcommon.utils.StatusBarUtils ...@@ -34,6 +34,8 @@ import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.YDLCacheUtils import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.view.dialog.CommonDialog import com.ydl.ydlcommon.view.dialog.CommonDialog
import com.ydl.ydlnet.utils.log.AliYunLogConfig
import com.ydl.ydlnet.utils.log.AliYunLogHelper
import com.yidianling.common.tools.LogUtil import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxAppTool import com.yidianling.common.tools.RxAppTool
import com.yidianling.common.tools.RxKeyboardTool import com.yidianling.common.tools.RxKeyboardTool
...@@ -590,6 +592,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -590,6 +592,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
runOnUiThread { runOnUiThread {
showLoading(false) showLoading(false)
} }
if (chcekPhoneResponeBean != null && chcekPhoneResponeBean?.hasPwd == 1) {//用户码有设置密码:跳转到密登录 if (chcekPhoneResponeBean != null && chcekPhoneResponeBean?.hasPwd == 1) {//用户码有设置密码:跳转到密登录
InputPassWordActivity.start( InputPassWordActivity.start(
this, this,
......
...@@ -8,6 +8,8 @@ import com.ydl.ydlcommon.utils.StringUtils ...@@ -8,6 +8,8 @@ import com.ydl.ydlcommon.utils.StringUtils
import com.ydl.ydlcommon.utils.YDLCacheUtils import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.log.LogHelper import com.ydl.ydlcommon.utils.log.LogHelper
import com.ydl.ydlnet.utils.log.AliYunLogConfig
import com.ydl.ydlnet.utils.log.AliYunLogHelper
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.LoginUtils import com.yidianling.user.LoginUtils
import com.yidianling.user.StatusUtils import com.yidianling.user.StatusUtils
...@@ -28,7 +30,9 @@ import java.math.BigDecimal ...@@ -28,7 +30,9 @@ import java.math.BigDecimal
* @Company 壹点灵 * @Company 壹点灵
* @date 2018/12/2 * @date 2018/12/2
*/ */
class InputPassWordPresenterImpl : BasePresenter<IInputPassWordContract.View, IInputPassWordContract.Model>(), IInputPassWordContract.Presenter { class InputPassWordPresenterImpl :
BasePresenter<IInputPassWordContract.View, IInputPassWordContract.Model>(),
IInputPassWordContract.Presenter {
override fun createModel(): IInputPassWordContract.Model { override fun createModel(): IInputPassWordContract.Model {
return InputPassWordModelImpl() return InputPassWordModelImpl()
...@@ -37,38 +41,51 @@ class InputPassWordPresenterImpl : BasePresenter<IInputPassWordContract.View, II ...@@ -37,38 +41,51 @@ class InputPassWordPresenterImpl : BasePresenter<IInputPassWordContract.View, II
/** /**
* 重新设置密码 * 重新设置密码
*/ */
override fun resetPwd(newPassword: String, phone: String, msgCode: String, phoneCountryCode: String) { override fun resetPwd(
newPassword: String,
phone: String,
msgCode: String,
phoneCountryCode: String
) {
ActionCountUtils.count(UserBIConstants.POSITION_LOGIN_CLICK, UserBIConstants.ACTION_TYPE_RESET_PWD) ActionCountUtils.count(
UserBIConstants.POSITION_LOGIN_CLICK,
UserBIConstants.ACTION_TYPE_RESET_PWD
)
var param = PhoneResetPwdParam(StringUtils.md5(newPassword), phoneCountryCode, msgCode, phone) var param =
PhoneResetPwdParam(StringUtils.md5(newPassword), phoneCountryCode, msgCode, phone)
mModel.resetPwd(param) mModel.resetPwd(param)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.doOnSubscribe { mView.showLoading(true) } .doOnSubscribe { mView.showLoading(true) }
.doAfterTerminate { mView.showLoading(false) } .doAfterTerminate { mView.showLoading(false) }
.subscribe({ .subscribe({
if (it?.data == null) { if (it?.data == null) {
ToastUtil.toastShort(it.msg) ToastUtil.toastShort(it.msg)
} else {
if (it.data.userInfo?.user_type == 2) {
mView.showNormalDialog()
} else { } else {
if (it.data.userInfo?.user_type == 2) { ToastUtil.toastShort("修改密码成功")
mView.showNormalDialog() saveUserData(it.data)
ActionCountUtils.countUid(
UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK,
it.data.uid!!,
UserBIConstants.ACTION_TYPE_RESET_PWD
)
if (it.data.firstLogin == 1) {//第一次登录:是注册
StatusUtils.isFirstLogin = true
// 重设密码登录已经不可能是首次登录,所以不进行百度埋点
//view.baiduActionBury()
} else { } else {
ToastUtil.toastShort("修改密码成功")
saveUserData(it.data)
ActionCountUtils.countUid(UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK,it.data.uid!!,UserBIConstants.ACTION_TYPE_RESET_PWD)
if (it.data.firstLogin == 1) {//第一次登录:是注册
StatusUtils.isFirstLogin = true
// 重设密码登录已经不可能是首次登录,所以不进行百度埋点
//view.baiduActionBury()
} else {
}
mView.closeActivity()
} }
mView.closeActivity()
} }
}, { }
YdlCommonOut.showToast(it.message!!) }, {
}) YdlCommonOut.showToast(it.message!!)
})
} }
...@@ -76,36 +93,54 @@ class InputPassWordPresenterImpl : BasePresenter<IInputPassWordContract.View, II ...@@ -76,36 +93,54 @@ class InputPassWordPresenterImpl : BasePresenter<IInputPassWordContract.View, II
* 手机号密码登录 * 手机号密码登录
*/ */
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
override fun userLoginByPassword(inputPassword: String, phone: String, phoneCountryCode: String) { override fun userLoginByPassword(
ActionCountUtils.count( UserBIConstants.POSITION_LOGIN_CLICK,UserBIConstants.ACTION_TYPE_PWD_LOGIN) inputPassword: String,
phone: String,
phoneCountryCode: String
) {
ActionCountUtils.count(
UserBIConstants.POSITION_LOGIN_CLICK,
UserBIConstants.ACTION_TYPE_PWD_LOGIN
)
var param = PhoneLoginPwdParam(StringUtils.md5(inputPassword), phoneCountryCode, phone) var param = PhoneLoginPwdParam(StringUtils.md5(inputPassword), phoneCountryCode, phone)
mModel.userLoginByPassword(param) mModel.userLoginByPassword(param)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.doOnSubscribe { mView.showLoading(true) } .doOnSubscribe { mView.showLoading(true) }
.doAfterTerminate { mView.showLoading(false) } .doAfterTerminate { mView.showLoading(false) }
.subscribe({ .subscribe({
if (it?.data == null) { if (it?.data == null) {
ToastUtil.toastShort(it.msg) AliYunLogHelper.getInstance()
mView.startAnim() .sendLog(AliYunLogConfig.LOGIN, "手机号密码 登录失败 msg: ${it.msg}")
ToastUtil.toastShort(it.msg)
mView.startAnim()
} else {
if (it.data.userInfo?.user_type == 2) {
mView.showNormalDialog()
} else { } else {
if (it.data.userInfo?.user_type == 2) { saveUserData(it.data)
mView.showNormalDialog() if (it.data.firstLogin == 1) {//第一次登录:是注册
StatusUtils.isFirstLogin = true
mView.baiduActionBury()
} else { } else {
saveUserData(it.data) ActionCountUtils.countUid(
if (it.data.firstLogin == 1) {//第一次登录:是注册 UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK,
StatusUtils.isFirstLogin = true it.data.uid!!,
mView.baiduActionBury() UserBIConstants.ACTION_TYPE_PWD_LOGIN
} else { )
ActionCountUtils.countUid(UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK,it.data.uid!!,UserBIConstants.ACTION_TYPE_PWD_LOGIN)
}
mView.closeActivity()
} }
mView.closeActivity()
} }
}, { AliYunLogHelper.getInstance().sendLog(AliYunLogConfig.LOGIN, "手机号密码 登录成功")
YdlCommonOut.showToast(it.message!!)
}) }
}, {
YdlCommonOut.showToast(it.message!!)
AliYunLogHelper.getInstance()
.sendLog(AliYunLogConfig.LOGIN, "手机号密码 Error msg: ${it.message}")
})
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment