Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
Project
Project
Details
Activity
Releases
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
bp
ShenghuoquanBusiness
Commits
6aa68eee
Commit
6aa68eee
authored
May 27, 2021
by
zhenghongbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add 短信、登录、身份列表接口
parent
4d744424
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
195 additions
and
104 deletions
+195
-104
AppConfig.kt
...onLib/Common/src/main/java/com/yidian/common/AppConfig.kt
+4
-5
HawkConfig.kt
...nLib/Common/src/main/java/com/yidian/common/HawkConfig.kt
+9
-2
HttpParamsUtils.kt
...n/src/main/java/com/yidian/common/http/HttpParamsUtils.kt
+7
-8
URLs.kt
...onLib/Common/src/main/java/com/yidian/common/http/URLs.kt
+3
-1
ApiService.kt
...va/com/yidian/shenghuoquan/newscontent/http/ApiService.kt
+51
-17
CommonService.kt
...com/yidian/shenghuoquan/newscontent/http/CommonService.kt
+9
-4
AccountItemBean.kt
...shenghuoquan/newscontent/http/httpbean/AccountItemBean.kt
+14
-0
IMobileLoginCallback.kt
...huoquan/newscontent/http/httpbean/IMobileLoginCallback.kt
+9
-0
MobileLoginBean.kt
...shenghuoquan/newscontent/http/httpbean/MobileLoginBean.kt
+12
-12
RequestService.kt
...yidian/shenghuoquan/newscontent/service/RequestService.kt
+0
-53
LifeAccountIdentityActivity.kt
...henghuoquan/newscontent/ui/LifeAccountIdentityActivity.kt
+8
-0
LoginLifeCircleActivity.kt
...an/shenghuoquan/newscontent/ui/LoginLifeCircleActivity.kt
+69
-2
No files found.
CommonLib/Common/src/main/java/com/yidian/common/AppConfig.kt
View file @
6aa68eee
...
...
@@ -8,6 +8,10 @@ class AppConfig {
const
val
appid
=
"merchant-b"
const
val
cv
=
"1.0.0.7"
const
val
version
=
"000100"
const
val
distribution
=
"official"
const
val
platform
=
"1"
//地铁项目
...
...
@@ -20,11 +24,6 @@ class AppConfig {
const
val
SinaCallBackUrl
=
"https://api.weibo.com/oauth2/default.html"
const
val
FileProvider
=
"com.yidian.subway.provider"
const
val
cv
=
"1.0.0.7"
const
val
version
=
"000100"
const
val
distribution
=
"official"
const
val
platform
=
"1"
const
val
privacyPolicyStatement
=
"http://www.yidianzixun.com/landing_privacy?yidian_fs=2"
const
val
userProtocol
=
"http://www.yidianzixun.com/landing_agreement?yidian_fs=2"
...
...
CommonLib/Common/src/main/java/com/yidian/common/HawkConfig.kt
View file @
6aa68eee
...
...
@@ -3,7 +3,7 @@ package com.yidian.common
class
HawkConfig
{
companion
object
{
const
val
GuestAccountUsername
=
"guestAccountUsername"
const
val
LoginStatus
=
"loginStatus"
const
val
Cookie
=
"cookie"
const
val
UmToken
=
"UmToken"
const
val
HeadViewHeight
=
"headViewHeight"
...
...
@@ -13,8 +13,15 @@ class HawkConfig {
const
val
ProtocolIsAgree
=
"protocolIsAgree"
const
val
ChameleonDebugRemote
=
"ChameleonDebugRemote"
const
val
Username
=
"username"
const
val
Nickname
=
"nickname"
const
val
ProfileUrl
=
"profileUrl"
const
val
GifData
=
"gifData"
//生活圈
const
val
LoginStatus
=
"loginStatus"
const
val
UserId
=
"userId"
const
val
Mobile
=
"mobile"
const
val
Nickname
=
"nickname"
const
val
Avatar
=
"avatar"
}
}
\ No newline at end of file
CommonLib/Common/src/main/java/com/yidian/common/http/HttpParamsUtils.kt
View file @
6aa68eee
...
...
@@ -13,14 +13,13 @@ class HttpParamsUtils{
val
timeStamp
=
System
.
currentTimeMillis
()
val
queryParamsMap
=
HashMap
<
String
,
String
>()
queryParamsMap
[
"appid"
]
=
AppConfig
.
appid
// queryParamsMap["cv"] = AppConfig.cv
// queryParamsMap["version"] = AppConfig.version
// queryParamsMap["distribution"] = AppConfig.distribution
// queryParamsMap["net_type"] = networkType
// queryParamsMap["platform"] = AppConfig.platform
// queryParamsMap["equipment_id"] = getEquipmentId()
// queryParamsMap["request_id"] = getRequestId(timeStamp)
// queryParamsMap["sign_string"] = getSignString(timeStamp)
queryParamsMap
[
"cv"
]
=
AppConfig
.
cv
queryParamsMap
[
"version"
]
=
AppConfig
.
version
queryParamsMap
[
"distribution"
]
=
AppConfig
.
distribution
queryParamsMap
[
"net"
]
=
networkType
queryParamsMap
[
"platform"
]
=
AppConfig
.
platform
queryParamsMap
[
"equipment_id"
]
=
getEquipmentId
()
queryParamsMap
[
"reqid"
]
=
getRequestId
(
timeStamp
)
return
queryParamsMap
}
...
...
CommonLib/Common/src/main/java/com/yidian/common/http/URLs.kt
View file @
6aa68eee
...
...
@@ -19,7 +19,6 @@ class URLs {
const
val
guestLogin
=
"/login/login/guest"
const
val
sendSmsCode
=
"/login/login/send_sms_code"
const
val
mobileLogin
=
"/login/login/mobile_login"
const
val
videoCommentList
=
"/content/comment/list"
const
val
videoAddComment
=
"/content/comment/add"
const
val
addCollection
=
"/user/collect/add"
...
...
@@ -51,5 +50,8 @@ class URLs {
const
val
getKSYunObjectId
=
"Ksy/ksyun/buildObectid"
const
val
getKSYunBucket
=
"Ksy/ksyun/getBucket"
const
val
businessLicenseOCR
=
"/Identify/BusLicense/businessLicenseOcr"
const
val
sendMsgCode
=
"/user/user/send_sms_code"
const
val
mobileLogin
=
"/user/user/login"
const
val
accountList
=
"/merchant/auth/account_list"
}
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/ApiService.kt
View file @
6aa68eee
...
...
@@ -22,6 +22,57 @@ import org.json.JSONObject
class
ApiService
{
companion
object
{
//获取短信验证码
fun
sendMsgCode
(
apiCallback
:
IMobileLoginCallback
,
requestParams
:
Map
<
String
,
String
>)
{
val
paramsMap
=
HttpParamsUtils
.
getParamsMap
()
ServiceFactory
.
getInstance
().
createService
(
CommonService
::
class
.
java
)
.
sendMsgCode
(
paramsMap
,
requestParams
)
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
subscribe
(
object
:
HttpResultSubscriber
<
Any
?>()
{
override
fun
onSuccess
(
result
:
HttpResult
<
Any
?
>?)
{
apiCallback
.
sendSmsCodeCallBack
(
result
)
}
override
fun
onFailer
(
result
:
HttpResult
<
Any
?
>?)
{
apiCallback
.
sendSmsCodeCallBack
(
result
)
}
})
}
//手机号登录登录接口
fun
mobileLogin
(
apiCallback
:
IMobileLoginCallback
,
requestParams
:
Map
<
String
,
String
>)
{
val
paramsMap
=
HttpParamsUtils
.
getParamsMap
()
ServiceFactory
.
getInstance
().
createService
(
CommonService
::
class
.
java
)
.
mobileLogin
(
paramsMap
,
requestParams
)
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
subscribe
(
object
:
HttpResultSubscriber
<
MobileLoginBean
.
Response
?>()
{
override
fun
onSuccess
(
result
:
HttpResult
<
MobileLoginBean
.
Response
?
>?)
{
apiCallback
.
mobileLoginCallBack
(
result
)
}
override
fun
onFailer
(
result
:
HttpResult
<
MobileLoginBean
.
Response
?
>?)
{
apiCallback
.
mobileLoginCallBack
(
result
)
}
})
}
//获取生活号列表
fun
getAccountList
(
apiCallback
:
IMobileLoginCallback
)
{
val
paramsMap
=
HttpParamsUtils
.
getParamsMap
()
ServiceFactory
.
getInstance
().
createService
(
CommonService
::
class
.
java
)
.
getAccountList
(
paramsMap
)
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
subscribe
(
object
:
HttpResultSubscriber
<
ArrayList
<
AccountItemBean
>?>()
{
override
fun
onSuccess
(
result
:
HttpResult
<
ArrayList
<
AccountItemBean
>?>?)
{
apiCallback
.
getAccountListCallBack
(
result
)
}
override
fun
onFailer
(
result
:
HttpResult
<
ArrayList
<
AccountItemBean
>?>?)
{
}
})
}
//获取活体检测接口
fun
identifyIdOcrVerify
(
apiCallback
:
IdentifyIdOcrVerifyCallback
,
requestParams
:
IdentifyIdOcrVerifyBean
.
Request
)
{
val
paramsMap
=
HttpParamsUtils
.
getParamsMap
()
...
...
@@ -164,23 +215,6 @@ class ApiService {
})
}
//手机号登录登录接口
fun
mobileLogin
(
apiCallback
:
ILoginCallback
,
requestParams
:
MobileLoginBean
.
Request
)
{
val
paramsMap
=
HttpParamsUtils
.
getParamsMap
()
ServiceFactory
.
getInstance
().
createService
(
CommonService
::
class
.
java
)
.
mobileLogin
(
paramsMap
,
requestParams
)
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
subscribe
(
object
:
HttpResultSubscriber
<
MobileLoginBean
.
Response
?>()
{
override
fun
onSuccess
(
result
:
HttpResult
<
MobileLoginBean
.
Response
?
>?)
{
apiCallback
.
mobileLoginCallBack
(
result
)
}
override
fun
onFailer
(
result
:
HttpResult
<
MobileLoginBean
.
Response
?
>?)
{
apiCallback
.
mobileLoginCallBack
(
result
)
}
})
}
//退出登录
fun
logout
(
apiCallback
:
ILoginCallback
)
{
val
paramsMap
=
HttpParamsUtils
.
getParamsMap
()
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/CommonService.kt
View file @
6aa68eee
...
...
@@ -17,10 +17,6 @@ interface CommonService {
@GET
(
URLs
.
sendSmsCode
)
fun
sendSmsCode
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@QueryMap
requestParams
:
Map
<
String
,
String
>):
Observable
<
HttpResult
<
Any
?
>>
@Headers
(
"Content-Type: application/json"
)
@POST
(
URLs
.
mobileLogin
)
fun
mobileLogin
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
requestParams
:
MobileLoginBean
.
Request
):
Observable
<
HttpResult
<
MobileLoginBean
.
Response
?
>>
@GET
(
URLs
.
logout
)
fun
logout
(
@QueryMap
commonParams
:
Map
<
String
,
String
>):
Observable
<
HttpResult
<
Any
?
>>
...
...
@@ -130,4 +126,13 @@ interface CommonService {
@Headers
(
"Content-Type: application/json"
)
@POST
(
URLs
.
businessLicenseOCR
)
fun
businessLicenseOCR
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
requestParams
:
BusinessLicenseOCRBean
.
Request
)
:
Observable
<
HttpResult
<
BusinessLicenseOCRBean
.
Response
>>
@GET
(
URLs
.
sendMsgCode
)
fun
sendMsgCode
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@QueryMap
requestParams
:
Map
<
String
,
String
>):
Observable
<
HttpResult
<
Any
?
>>
@GET
(
URLs
.
mobileLogin
)
fun
mobileLogin
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@QueryMap
requestParams
:
Map
<
String
,
String
>):
Observable
<
HttpResult
<
MobileLoginBean
.
Response
?
>>
@GET
(
URLs
.
accountList
)
fun
getAccountList
(
@QueryMap
commonParams
:
Map
<
String
,
String
>):
Observable
<
HttpResult
<
ArrayList
<
AccountItemBean
>?>>
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/httpbean/AccountItemBean.kt
0 → 100644
View file @
6aa68eee
package
com.yidian.shenghuoquan.newscontent.http.httpbean
class
AccountItemBean
(
var
response
:
Response
)
{
data class
Response
(
val
create_time
:
String
,
val
enterprise_audit_status
:
Int
,
val
life_account_auth_status
:
Int
,
val
life_account_id
:
Long
,
val
life_account_name
:
String
,
val
life_account_status
:
Int
,
val
life_account_type
:
Int
,
val
role_type
:
Int
)
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/httpbean/IMobileLoginCallback.kt
0 → 100644
View file @
6aa68eee
package
com.yidian.shenghuoquan.newscontent.http.httpbean
import
com.yidian.common.http.HttpResult
interface
IMobileLoginCallback
{
fun
sendSmsCodeCallBack
(
t
:
HttpResult
<
Any
?
>?)
fun
mobileLoginCallBack
(
t
:
HttpResult
<
MobileLoginBean
.
Response
?
>?)
fun
getAccountListCallBack
(
t
:
HttpResult
<
ArrayList
<
AccountItemBean
>?>?)
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/httpbean/MobileLoginBean.kt
View file @
6aa68eee
package
com.yidian.shenghuoquan.newscontent.http.httpbean
class
MobileLoginBean
(
var
request
:
Request
,
var
response
:
Response
)
{
data class
Request
(
var
mobile
:
String
?,
var
code
:
String
?,
var
password
:
String
?)
data class
Request
(
var
mobile
:
String
?,
var
code
:
String
?)
data class
Response
(
val
createTime
:
String
?,
val
fontsize
:
String
?,
val
freshuser
:
Boolean
?,
val
global_id
:
String
?,
val
login
:
Boolean
?,
val
maskmobile
:
String
?,
val
nickname
:
String
?,
val
profile_url
:
String
?,
val
username
:
String
?,
val
usertype
:
String
?,
val
utk
:
String
?
val
app_id
:
Int
,
val
app_name
:
String
,
val
avatar
:
String
,
val
city_id
:
String
,
val
city_name
:
String
,
val
gender
:
Int
,
val
gender_text
:
String
,
val
mobile
:
String
,
val
nick_name
:
String
,
val
user_id
:
Long
)
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/service/RequestService.kt
View file @
6aa68eee
...
...
@@ -81,43 +81,6 @@ class RequestService : ZapService() {
ApiService
.
guestLogin
(
guestLoginImpl
,
requestBean
)
}
private
val
loginImpl
=
object
:
ILoginCallback
{
override
fun
sendSmsCodeCallBack
(
t
:
HttpResult
<
Any
?
>?)
{
val
params
=
Gson
().
toJson
(
t
)
resolver
.
success
(
JSONObject
(
params
))
}
override
fun
mobileLoginCallBack
(
t
:
HttpResult
<
MobileLoginBean
.
Response
?
>?)
{
val
params
=
Gson
().
toJson
(
t
)
resolver
.
success
(
JSONObject
(
params
))
if
(
t
?.
code
==
0
)
{
val
loginBean
=
t
.
result
Hawk
.
put
(
HawkConfig
.
LoginStatus
,
true
)
Hawk
.
put
(
HawkConfig
.
Username
,
loginBean
?.
username
)
Hawk
.
put
(
HawkConfig
.
Nickname
,
loginBean
?.
nickname
)
Hawk
.
put
(
HawkConfig
.
ProfileUrl
,
loginBean
?.
profile_url
)
subscriptionManager
.
initAuthorSubscribeList
()
bindPushToken
()
}
}
private
fun
bindPushToken
()
{
val
data
=
ToolsUtil
.
getYDEncryptionToken
()
val
pushLevel
=
AppConfig
.
PUSH_LEVEL
+
ToolsUtil
.
getDeviceBrandMask
()
val
requestParams
=
PushTokenAndroidBean
.
Request
(
""
,
data
,
1
,
1
,
Hawk
.
get
(
HawkConfig
.
UmToken
),
pushLevel
)
ApiService
.
pushTokenAndroid
(
requestParams
)
}
override
fun
logoutCallBack
(
t
:
HttpResult
<
Any
?
>?)
{
val
params
=
Gson
().
toJson
(
t
)
resolver
.
success
(
JSONObject
(
params
))
if
(
t
?.
code
==
0
)
{
Hawk
.
put
(
HawkConfig
.
LoginStatus
,
false
)
guestLogin
()
}
}
}
private
val
videoContentImpl
=
object
:
IVideoContentCallback
{
override
fun
videoContentDetailCallback
(
t
:
HttpResult
<
MutableList
<
VideoContentDetailBean
>?>?)
{
...
...
@@ -163,22 +126,6 @@ class RequestService : ZapService() {
private
fun
requestApi
(
path
:
String
,
params
:
JSONObject
)
{
when
(
path
)
{
URLs
.
sendSmsCode
->
{
val
mobile
=
params
.
optString
(
"mobile"
)
val
requestMap
=
HashMap
<
String
,
String
>()
requestMap
[
"mobile"
]
=
mobile
ApiService
.
sendSmsCode
(
loginImpl
,
requestMap
)
}
URLs
.
mobileLogin
->
{
val
mobile
=
params
.
optString
(
"mobile"
)
val
code
=
params
.
optString
(
"code"
)
val
password
=
AccountUtil
.
getPassword
(
mobile
)
val
requestParams
=
MobileLoginBean
.
Request
(
mobile
,
code
,
password
)
ApiService
.
mobileLogin
(
loginImpl
,
requestParams
)
}
URLs
.
logout
->
{
ApiService
.
logout
(
loginImpl
)
}
URLs
.
videoCommentList
->
{
val
docId
=
params
.
optString
(
"docid"
)
val
pageSize
=
params
.
optInt
(
"page_size"
)
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/LifeAccountIdentityActivity.kt
View file @
6aa68eee
...
...
@@ -13,6 +13,8 @@ import com.yidian.shenghuoquan.newscontent.adapter.LifeAccountIdentityAdapter
import
com.yidian.shenghuoquan.newscontent.bean.LifeAccountIdentityBean
import
com.yidian.shenghuoquan.newscontent.databinding.ActivityLifeAccountIdentityBinding
import
com.yidian.xpage.XPageManager
import
com.yidian.yac.core.zap.ZapTicket
import
org.json.JSONObject
/**
* author: yinjiacheng
...
...
@@ -44,6 +46,12 @@ class LifeAccountIdentityActivity : BaseActivity<ActivityLifeAccountIdentityBind
}
private
fun
initData
()
{
val
paramsMap
=
intent
?.
getSerializableExtra
(
XRouterPathConstants
.
ParamsKey
)
if
(
paramsMap
!=
null
)
{
paramsMap
as
HashMap
<
String
,
Any
?>
val
accountList
=
paramsMap
[
"accountList"
]
}
val
data
:
List
<
LifeAccountIdentityBean
>
=
listOf
(
LifeAccountIdentityBean
(
"一点网娱商业化大佬们的生活号还有更多文字可以换行"
,
"超级管理员"
),
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/LoginLifeCircleActivity.kt
View file @
6aa68eee
...
...
@@ -3,15 +3,28 @@ package com.yidian.shenghuoquan.newscontent.ui
import
android.os.Bundle
import
android.text.Editable
import
android.text.TextWatcher
import
android.util.Log
import
com.google.gson.Gson
import
com.orhanobut.hawk.Hawk
import
com.yidian.common.AppConfig
import
com.yidian.common.HawkConfig
import
com.yidian.common.XRouterPathConstants
import
com.yidian.common.XRouterPathConstants.Companion.LOGIN_LIFE_CIRCLE
import
com.yidian.common.base.BaseActivity
import
com.yidian.common.http.HttpResult
import
com.yidian.common.utils.ToolsUtil
import
com.yidian.common.utils.YdToastUtil
import
com.yidian.common.widget.EditTextInputCallback
import
com.yidian.common.widget.PhoneNumberTextWatcher
import
com.yidian.shenghuoquan.newscontent.databinding.ActivityLoginBinding
import
com.yidian.shenghuoquan.newscontent.http.ApiService
import
com.yidian.shenghuoquan.newscontent.http.httpbean.*
import
com.yidian.shenghuoquan.newscontent.subscription.subscriptionManager
import
com.yidian.shenghuoquan.newscontent.utils.CountDownTimerUtils
import
com.yidian.utils.ToastUtil
import
com.yidian.xpage.XPageManager
import
com.yidian.yac.ftdevicefinger.core.FtDeviceFingerManager
import
org.json.JSONObject
/**
* Author: zhb
...
...
@@ -45,7 +58,14 @@ class LoginLifeCircleActivity : BaseActivity<ActivityLoginBinding>() {
private
fun
setOnListener
()
{
viewBind
.
tvGetCode
.
setOnClickListener
{
mCountDownTimerUtils
.
start
()
val
mobile
=
viewBind
.
etMobileNo
.
text
.
toString
().
replace
(
" "
,
""
)
if
(
mobile
.
length
==
11
){
val
paramsMap
=
HashMap
<
String
,
String
>()
paramsMap
[
"mobile"
]
=
mobile
ApiService
.
sendMsgCode
(
loginImpl
,
paramsMap
)
}
else
{
ToastUtil
.
showToast
(
this
,
"请输入11位手机号"
)
}
}
viewBind
.
etMobileNo
.
addTextChangedListener
(
PhoneNumberTextWatcher
(
viewBind
.
etMobileNo
,
object
:
EditTextInputCallback
{
...
...
@@ -82,7 +102,12 @@ class LoginLifeCircleActivity : BaseActivity<ActivityLoginBinding>() {
})
viewBind
.
tvLogin
.
setOnClickListener
{
XPageManager
.
push
(
XRouterPathConstants
.
LIFE_ACCOUNT_IDENTITY
,
null
)
val
mobile
=
viewBind
.
etMobileNo
.
text
.
toString
().
replace
(
" "
,
""
)
val
code
=
viewBind
.
etCode
.
text
.
toString
()
val
paramsMap
=
HashMap
<
String
,
String
>()
paramsMap
[
"mobile"
]
=
mobile
paramsMap
[
"code"
]
=
code
ApiService
.
mobileLogin
(
loginImpl
,
paramsMap
)
}
viewBind
.
cbProtocol
.
setOnCheckedChangeListener
{
buttonView
,
isChecked
->
...
...
@@ -117,4 +142,46 @@ class LoginLifeCircleActivity : BaseActivity<ActivityLoginBinding>() {
viewBind
.
tvLogin
.
isEnabled
=
false
}
}
private
fun
getAccountList
(){
ApiService
.
getAccountList
(
loginImpl
)
}
private
val
loginImpl
=
object
:
IMobileLoginCallback
{
override
fun
sendSmsCodeCallBack
(
t
:
HttpResult
<
Any
?
>?)
{
if
(
t
?.
code
==
0
){
mCountDownTimerUtils
.
start
()
}
}
override
fun
mobileLoginCallBack
(
t
:
HttpResult
<
MobileLoginBean
.
Response
?
>?)
{
val
loginResponse
=
t
?.
result
Hawk
.
put
(
HawkConfig
.
LoginStatus
,
true
)
Hawk
.
put
(
HawkConfig
.
UserId
,
loginResponse
?.
user_id
)
Hawk
.
put
(
HawkConfig
.
Mobile
,
loginResponse
?.
mobile
)
Hawk
.
put
(
HawkConfig
.
Nickname
,
loginResponse
?.
nick_name
)
Hawk
.
put
(
HawkConfig
.
Avatar
,
loginResponse
?.
avatar
)
getAccountList
()
}
override
fun
getAccountListCallBack
(
t
:
HttpResult
<
ArrayList
<
AccountItemBean
>?>?)
{
val
accountList
=
t
?.
result
if
(
accountList
!=
null
){
when
(
accountList
.
size
){
0
->
{
//没有身份
}
1
->
{
//一个身份
val
paramsMap
=
HashMap
<
String
,
Any
?>()
paramsMap
[
"accountList"
]
=
accountList
}
else
->
{
//多个身份
val
paramsMap
=
HashMap
<
String
,
Any
?>()
paramsMap
[
"accountList"
]
=
accountList
XPageManager
.
push
(
XRouterPathConstants
.
LIFE_ACCOUNT_IDENTITY
,
paramsMap
)
}
}
}
}
}
}
\ No newline at end of file
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