Commit e96276b6 by YKai

feat:代码优化

parent a1ed8f19
......@@ -60,7 +60,8 @@ class UserBIConstants {
const val ACTION_TYPE_CODE_LOGIN: String = "code_login" //验证码登录
const val ACTION_TYPE_RESET_PWD: String = "reset_pwd" //重置密码登录
const val ACTION_TYPE_PWD_LOGIN: String = "pwd_login" //手机号密码登录
const val ACTION_TYPE_DIRECT_LOGIN: String = "direct_login" //一键登录
const val ACTION_TYPE_DIRECT_LOGIN: String = "direct_login" //一键本机号码校验登录
const val ACTION_TYPE_ONE_KEY_CLICK: String = "one_click_login" //一键登录
const val ACTION_TYPE_QQ_THIRD_LOGIN: String = "qq_login" //QQ登录
const val ACTION_TYPE_WX_THIRD_LOGIN: String = "wx_login" //WX登录
}
......
......@@ -15,22 +15,18 @@ import com.mobile.auth.gatewayauth.*
import com.mobile.auth.gatewayauth.model.TokenRet
import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.base.config.YDL_DOMAIN_LOGIN_BASE_URL
import com.ydl.ydlcommon.utils.ActivityManager
import com.ydl.ydlcommon.utils.JPushUtils
import com.ydl.ydlcommon.utils.LogUtil
import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.log.LogHelper
import com.ydl.ydlnet.builder.manage.HttpUrlManager
import com.yidianling.common.tools.RxAppTool
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.LoginUtils
import com.yidianling.user.StatusUtils
import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.bean.AliAuthBean
import com.yidianling.user.constants.UserBIConstants
import com.yidianling.user.http.LoginApiRequestUtil
import com.yidianling.user.http.request.PhoneLoginAutoParam
......@@ -77,6 +73,13 @@ object OneKeyLoginHelp {
} else if (appType == YDL_EXPERT_APP) {
it.setAuthSDKInfo(YDL_EXPERT_APP_KEY)
}
// 控件点击事件
it.setUIClickListener { code, context, json ->
if (code=="700002"){ // 表示一键登录按钮点击事件
ActionCountUtils.countUid(UserBIConstants.PART_ID_LOGIN_MAIN,UserBIConstants.ACTION_TYPE_ONE_KEY_CLICK)
}
}
}
// 获取渠道
val channel = WalleChannelReader.getChannel(activity)
......@@ -331,8 +334,8 @@ object OneKeyLoginHelp {
LogUtil.e("唤起授权页成功:$s")
}
ResultCode.CODE_SUCCESS -> { // 获取token成功
val param = PhoneLoginAutoParam(tokenRet.token, JPushUtils.getRegistrationID(),2,2,"",
RxAppTool.getAppVersionName(BaseApp.Companion.getApp()))
val param = PhoneLoginAutoParam(tokenRet.token, "11111111111",2,2,"",
RxAppTool.getAppVersionName(BaseApp.Companion.getApp())) // JPushUtils.getRegistrationID()
LoginApiRequestUtil.autoLogin(param)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
......@@ -344,7 +347,7 @@ object OneKeyLoginHelp {
// 埋点
ActionCountUtils.baiduCount(it.data.uid, UserBIConstants.APP_REGISTER_PAGE, UserBIConstants.POSITION_ALIYUN_REGISTER_CLICK, "", "", 25)
} else {
ActionCountUtils.countUid(UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK,it.data.uid!!,UserBIConstants.ACTION_TYPE_DIRECT_LOGIN)
ActionCountUtils.countUid(UserBIConstants.POSITION_LOGIN_SUCCESS_CLICK,it.data.uid!!,UserBIConstants.ACTION_TYPE_ONE_KEY_CLICK)
}
mPhoneNumberAuthHelper?.let { helper->
helper.hideLoginLoading()
......@@ -353,6 +356,9 @@ object OneKeyLoginHelp {
}
mIsGetTokenSuccess = false
LoginUtils.LoginSuccessOperate(mActivity)
}else{
ToastUtil.toastShort(it.msg)
mPhoneNumberAuthHelper?.hideLoginLoading()
}
}, {
toLoginActivity()
......
package com.ydl.ydlcommon.base.config;
import android.os.Build;
import android.support.annotation.RequiresApi;
import com.ydl.burypointlib.MD5Util;
import com.ydl.ydlcommon.utils.LogUtil;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* Created by Ykai on 2021/1/11.
*
......
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