Commit 8069f63c by YKai

feat:一键登录代码优化

parent bda2f90e
...@@ -118,12 +118,6 @@ interface UserApi { ...@@ -118,12 +118,6 @@ interface UserApi {
@POST("phone/verification/init") @POST("phone/verification/init")
fun checkAliAuth(@Body body: RequestBody): Observable<BaseResponse<PhoneAuthResponseBean>> fun checkAliAuth(@Body body: RequestBody): Observable<BaseResponse<PhoneAuthResponseBean>>
//第三方登录获取用户信息
@POST("login/v2/login_wechat_qq")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL,LOGIN_USER_PORT)
fun thirdPartJavaLogin(@Body body: RequestBody): Observable<BaseResponse<UserResponseBean>>
//获取隐私政策数据 //获取隐私政策数据
@GET("site/get-privacy-content") @GET("site/get-privacy-content")
fun getSecretData(): Observable<BaseResponse<SecretResponse>> fun getSecretData(): Observable<BaseResponse<SecretResponse>>
...@@ -152,6 +146,10 @@ interface UserApi { ...@@ -152,6 +146,10 @@ interface UserApi {
//第三方登录获取用户信息
@POST("login/v2/login_wechat_qq")
@Headers( YDL_DOMAIN+ YDL_DOMAIN_LOGIN_BASE_URL,LOGIN_USER_PORT)
fun thirdPartJavaLogin(@Body body: RequestBody): Observable<BaseResponse<UserResponseBean>>
/** /**
* 绑定手机号 * 绑定手机号
......
...@@ -16,6 +16,7 @@ import com.mobile.auth.gatewayauth.model.TokenRet ...@@ -16,6 +16,7 @@ import com.mobile.auth.gatewayauth.model.TokenRet
import com.ydl.ydlcommon.base.BaseActivity import com.ydl.ydlcommon.base.BaseActivity
import com.ydl.ydlcommon.base.BaseApp import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.utils.ActivityManager import com.ydl.ydlcommon.utils.ActivityManager
import com.ydl.ydlcommon.utils.JPushUtils
import com.ydl.ydlcommon.utils.LogUtil 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
...@@ -310,7 +311,7 @@ object OneKeyLoginHelp { ...@@ -310,7 +311,7 @@ object OneKeyLoginHelp {
AuthUIConfig.Builder() AuthUIConfig.Builder()
.setStatusBarColor(Color.TRANSPARENT) .setStatusBarColor(Color.TRANSPARENT)
.setWebViewStatusBarColor(Color.TRANSPARENT) .setWebViewStatusBarColor(Color.TRANSPARENT)
.setStatusBarUIFlag(View.SYSTEM_UI_FLAG_LOW_PROFILE) .setStatusBarUIFlag(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN)
.setNavText("登录解锁更多功能") .setNavText("登录解锁更多功能")
.setNavTextColor(Color.parseColor("#242424")) .setNavTextColor(Color.parseColor("#242424"))
.setWebNavTextColor(Color.parseColor("#242424")) // 设置协议页面标题字体颜色 .setWebNavTextColor(Color.parseColor("#242424")) // 设置协议页面标题字体颜色
...@@ -355,10 +356,13 @@ object OneKeyLoginHelp { ...@@ -355,10 +356,13 @@ object OneKeyLoginHelp {
when (tokenRet.code) { when (tokenRet.code) {
ResultCode.CODE_START_AUTHPAGE_SUCCESS -> { // 唤起一键登录页面成功 ResultCode.CODE_START_AUTHPAGE_SUCCESS -> { // 唤起一键登录页面成功
LogUtil.e("唤起授权页成功:$s") LogUtil.e("唤起授权页成功:$s")
if (mIsFromGuide){
mActivity.finish()
}
} }
ResultCode.CODE_SUCCESS -> { // 获取token成功 ResultCode.CODE_SUCCESS -> { // 获取token成功
val param = PhoneLoginAutoParam(tokenRet.token, "11111111111",2,2,"", val param = PhoneLoginAutoParam(tokenRet.token, JPushUtils.getRegistrationID(),2,2,"",
RxAppTool.getAppVersionName(BaseApp.Companion.getApp())) // JPushUtils.getRegistrationID() RxAppTool.getAppVersionName(BaseApp.Companion.getApp()))
LoginApiRequestUtil.autoLogin(param) LoginApiRequestUtil.autoLogin(param)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
......
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
tools:ignore="ResourceName"> tools:ignore="ResourceName">
<alpha <alpha
android:duration="0" android:duration="300"
android:fromAlpha="0"
android:toAlpha="1.0"
/> />
</set> </set>
...@@ -3,7 +3,9 @@ ...@@ -3,7 +3,9 @@
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
tools:ignore="ResourceName"> tools:ignore="ResourceName">
<alpha <alpha
android:duration="0" android:duration="300"
android:fromAlpha="1"
android:toAlpha="0"
/> />
</set> </set>
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