Commit 3b22fff6 authored by mengcuiguang's avatar mengcuiguang

代码优化

parent f6439d7b
...@@ -40,9 +40,7 @@ object AlipayAuthManager { ...@@ -40,9 +40,7 @@ object AlipayAuthManager {
) { ) {
// 获取alipay_open_id,调支付时作为参数extern_token 的value // 获取alipay_open_id,调支付时作为参数extern_token 的value
// 传入,则支付账户为该授权账户 // 传入,则支付账户为该授权账户
UserManager.getInstance().alipaySet = true
println("mcg -->>>>> authinfo=" + JsonUtil.toJson(authResult)) println("mcg -->>>>> authinfo=" + JsonUtil.toJson(authResult))
authListener?.authSuccess()
commitAlipayAutoInfo(JsonUtil.toJson(authResult)) commitAlipayAutoInfo(JsonUtil.toJson(authResult))
} else { } else {
// 其他状态值则为授权失败 // 其他状态值则为授权失败
...@@ -63,11 +61,17 @@ object AlipayAuthManager { ...@@ -63,11 +61,17 @@ object AlipayAuthManager {
.call(baseApplication.loanService.reportAlipayMsg(vo), .call(baseApplication.loanService.reportAlipayMsg(vo),
object : BaseSubscriber<BaseResponse<Any>>() { object : BaseSubscriber<BaseResponse<Any>>() {
override fun onError(e: Throwable) { override fun onError(e: Throwable) {
authListener?.authFail("授权失败!")
} }
override fun onNext(t: BaseResponse<Any>) { override fun onNext(t: BaseResponse<Any>) {
if (t.status == 200) {
UserManager.getInstance().alipaySet = true
authListener?.authSuccess()
} else {
authListener?.authFail(t.message)
}
} }
}) })
} }
......
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