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
8069f63c
Commit
8069f63c
authored
Jan 13, 2021
by
YKai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:一键登录代码优化
parent
bda2f90e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
11 deletions
+17
-11
UserApi.kt
m-user/src/main/java/com/yidianling/user/http/UserApi.kt
+4
-6
OneKeyLoginHelp.kt
m-user/src/main/java/com/yidianling/user/ui/login/OneKeyLoginHelp.kt
+7
-3
in_activity.xml
m-user/src/main/res/anim/in_activity.xml
+3
-1
out_activity.xml
m-user/src/main/res/anim/out_activity.xml
+3
-1
No files found.
m-user/src/main/java/com/yidianling/user/http/UserApi.kt
View file @
8069f63c
...
...
@@ -118,12 +118,6 @@ interface UserApi {
@POST
(
"phone/verification/init"
)
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"
)
fun
getSecretData
():
Observable
<
BaseResponse
<
SecretResponse
>>
...
...
@@ -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
>>
/**
* 绑定手机号
...
...
m-user/src/main/java/com/yidianling/user/ui/login/OneKeyLoginHelp.kt
View file @
8069f63c
...
...
@@ -16,6 +16,7 @@ import com.mobile.auth.gatewayauth.model.TokenRet
import
com.ydl.ydlcommon.base.BaseActivity
import
com.ydl.ydlcommon.base.BaseApp
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
...
...
@@ -310,7 +311,7 @@ object OneKeyLoginHelp {
AuthUIConfig
.
Builder
()
.
setStatusBarColor
(
Color
.
TRANSPARENT
)
.
setWebViewStatusBarColor
(
Color
.
TRANSPARENT
)
.
setStatusBarUIFlag
(
View
.
SYSTEM_UI_FLAG_L
OW_PROFILE
)
.
setStatusBarUIFlag
(
View
.
SYSTEM_UI_FLAG_L
AYOUT_FULLSCREEN
)
.
setNavText
(
"登录解锁更多功能"
)
.
setNavTextColor
(
Color
.
parseColor
(
"#242424"
))
.
setWebNavTextColor
(
Color
.
parseColor
(
"#242424"
))
// 设置协议页面标题字体颜色
...
...
@@ -355,10 +356,13 @@ object OneKeyLoginHelp {
when
(
tokenRet
.
code
)
{
ResultCode
.
CODE_START_AUTHPAGE_SUCCESS
->
{
// 唤起一键登录页面成功
LogUtil
.
e
(
"唤起授权页成功:$s"
)
if
(
mIsFromGuide
){
mActivity
.
finish
()
}
}
ResultCode
.
CODE_SUCCESS
->
{
// 获取token成功
val
param
=
PhoneLoginAutoParam
(
tokenRet
.
token
,
"11111111111"
,
2
,
2
,
""
,
RxAppTool
.
getAppVersionName
(
BaseApp
.
Companion
.
getApp
()))
// JPushUtils.getRegistrationID()
val
param
=
PhoneLoginAutoParam
(
tokenRet
.
token
,
JPushUtils
.
getRegistrationID
()
,
2
,
2
,
""
,
RxAppTool
.
getAppVersionName
(
BaseApp
.
Companion
.
getApp
()))
LoginApiRequestUtil
.
autoLogin
(
param
)
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
...
...
m-user/src/main/res/anim/in_activity.xml
View file @
8069f63c
...
...
@@ -3,6 +3,8 @@
xmlns:android=
"http://schemas.android.com/apk/res/android"
tools:ignore=
"ResourceName"
>
<alpha
android:duration=
"0"
android:duration=
"300"
android:fromAlpha=
"0"
android:toAlpha=
"1.0"
/>
</set>
m-user/src/main/res/anim/out_activity.xml
View file @
8069f63c
...
...
@@ -3,7 +3,9 @@
xmlns:android=
"http://schemas.android.com/apk/res/android"
tools:ignore=
"ResourceName"
>
<alpha
android:duration=
"0"
android:duration=
"300"
android:fromAlpha=
"1"
android:toAlpha=
"0"
/>
</set>
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