Commit 6aab85d4 by YKai

feat:一键登录代码优化

parent 72735bd1
...@@ -361,13 +361,13 @@ object OneKeyLoginHelp { ...@@ -361,13 +361,13 @@ object OneKeyLoginHelp {
} }
} }
ResultCode.CODE_SUCCESS -> { // 获取token成功 ResultCode.CODE_SUCCESS -> { // 获取token成功
val param = PhoneLoginAutoParam(tokenRet.token, JPushUtils.getRegistrationID(),2,2,"", val param = PhoneLoginAutoParam(tokenRet.token, JPushUtils.getRegistrationID(),2,2,"", RxAppTool.getAppVersionName(BaseApp.Companion.getApp()))
RxAppTool.getAppVersionName(BaseApp.Companion.getApp()))
LoginApiRequestUtil.autoLogin(param) LoginApiRequestUtil.autoLogin(param)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe({ .subscribe({
if (it.code == 200) { if (it.code == 200) {
ToastUtil.toastShort("登录成功")
saveUserData(it.data) saveUserData(it.data)
if (it.data.firstLogin == 1) {//第一次登录:是注册 if (it.data.firstLogin == 1) {//第一次登录:是注册
StatusUtils.isFirstLogin = true StatusUtils.isFirstLogin = true
......
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