wait continue
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.mogo.module.authorize.authprovider.biz
|
||||
|
||||
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_LAUNCHER_MAIN
|
||||
import com.mogo.module.authorize.authprovider.invoke.IMogoAuthorizeContentListener
|
||||
import com.mogo.module.authorize.model.BaseResponse
|
||||
import com.mogo.module.authorize.model.IMogoAuthorizeModel
|
||||
@@ -53,6 +54,10 @@ open class IMogoAuthorizeController {
|
||||
}
|
||||
}
|
||||
|
||||
private fun realInvokeAuthorizeContent(){
|
||||
|
||||
}
|
||||
|
||||
private inline fun getAuthorizeContentListener(tag: String, blockSuccess: ((IMogoAuthorizeContentListener) -> Unit), blockNull: (() -> Unit)) {
|
||||
val authorizeContentListener = MogoAuthorizeRegisterHandler.getAuthorizeContentListener(tag)
|
||||
if (authorizeContentListener != null) {
|
||||
@@ -62,4 +67,7 @@ open class IMogoAuthorizeController {
|
||||
}
|
||||
}
|
||||
|
||||
fun updateAgreementAndAuthorization(agreementType: Int) {
|
||||
invokeAuthorizeContent(AUTHORIZE_TYPE_LAUNCHER_MAIN, agreementType)
|
||||
}
|
||||
}
|
||||
@@ -11,16 +11,16 @@ open abstract class MogoAuthorizeManagerImpl : IMogoAuthorizeInvoke {
|
||||
|
||||
private val baseController: IMogoAuthorizeController by lazy { IMogoAuthorizeController() }
|
||||
|
||||
override fun needAuthorize(): Boolean {
|
||||
|
||||
return needAuthorization()
|
||||
override fun needAuthorize(tag: String): Boolean {
|
||||
val type = AuthorizeProxy.getAuthorizeType(tag)
|
||||
return needAuthorization(type)
|
||||
}
|
||||
|
||||
override fun invokeAuthorizeContent(tag: String) {
|
||||
//todo 后面动态代理统一处理校验问题
|
||||
Logger.d("invokeAuthorizeContent","tag:$tag")
|
||||
Logger.d("invokeAuthorizeContent", "tag:$tag")
|
||||
val agreementType = AuthorizeProxy.getAuthorizeType(tag)
|
||||
Logger.d("invokeAuthorizeContent","agreementType:$agreementType")
|
||||
Logger.d("invokeAuthorizeContent", "agreementType:$agreementType")
|
||||
baseController.invokeAuthorizeContent(tag, agreementType)
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ interface IMogoAuthorizeInvoke : IMogoAuthorizeRegister {
|
||||
/**
|
||||
* 是否需要授权
|
||||
*/
|
||||
fun needAuthorize(): Boolean
|
||||
fun needAuthorize(tag:String): Boolean
|
||||
|
||||
/**
|
||||
* 获取授权内容
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeManagerImpl
|
||||
import com.mogo.module.authorize.authprovider.biz.MogoAuthorizeRegisterHandler
|
||||
import com.mogo.module.authorize.authprovider.invoke.AuthorizeInvokerConstant.Companion.AUTHORIZE_TYPE_LAUNCHER_MAIN
|
||||
import com.mogo.module.authorize.fragment.AuthorizeFragment
|
||||
import com.mogo.module.authorize.model.proxy.AuthorizeProxy
|
||||
import com.mogo.module.authorize.util.SharedPreferenceUtil.hasAuth
|
||||
import com.mogo.service.IMogoServiceApis
|
||||
import com.mogo.service.MogoServicePaths
|
||||
@@ -60,7 +61,8 @@ class MogoMainAuthorize private constructor() : MogoAuthorizeManagerImpl(), IMog
|
||||
onError.invoke("invoke should be in main thread")
|
||||
return
|
||||
}
|
||||
if (hasAuth()) {
|
||||
val type = AuthorizeProxy.getAuthorizeType(tag)
|
||||
if (hasAuth(type)) {
|
||||
onError.invoke("already authorize,do not repeat operation")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -7,15 +7,15 @@ object SharedPreferenceUtil {
|
||||
|
||||
private const val HAS_AUTH = "HAS_AUTH"
|
||||
|
||||
fun needAuthorization(): Boolean {
|
||||
return !hasAuth()
|
||||
fun needAuthorization(type: Int): Boolean {
|
||||
return !hasAuth(type)
|
||||
}
|
||||
|
||||
fun hasAuth(): Boolean {
|
||||
return SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()).getBoolean(HAS_AUTH, false)
|
||||
fun hasAuth(type: Int): Boolean {
|
||||
return SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()).getBoolean(HAS_AUTH + type, false)
|
||||
}
|
||||
|
||||
fun setAuthorizeStatus() {
|
||||
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()).putBoolean(HAS_AUTH, true)
|
||||
fun setAuthorizeStatus(type: Int) {
|
||||
SharedPrefsMgr.getInstance(AbsMogoApplication.getApp()).putBoolean(HAS_AUTH + type, true)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user