|
@@ -20,6 +20,7 @@ abstract class BaseObserver<T> : Observer<XBaseEntity<T>> {
|
|
|
val TAG = "BaseObserver"
|
|
|
private val SUCCESS_CODE = 200
|
|
|
private val TOKENLOSEEFFICACY = 403
|
|
|
+ private val TOKENSTALEDATED = 401
|
|
|
|
|
|
override fun onSubscribe(@NonNull d: Disposable) {
|
|
|
logd("onSubscribe")
|
|
@@ -47,6 +48,19 @@ abstract class BaseObserver<T> : Observer<XBaseEntity<T>> {
|
|
|
User.savePadNo("")
|
|
|
User.saveOrgCode("")
|
|
|
JumpUtil.jumpActivity(RouterUrlCommon.login)
|
|
|
+ }else if (TOKENSTALEDATED == tBaseEntity.code){
|
|
|
+ User.saveMobile("")
|
|
|
+ User.saveIdCard("")
|
|
|
+ User.saveUserSex("")
|
|
|
+ User.saveUserAge("")
|
|
|
+ User.saveDoctorAvatar("")
|
|
|
+ User.saveAvatar("")
|
|
|
+ User.saveName("")
|
|
|
+ User.saveUserId("")
|
|
|
+ User.saveOrgCode("")
|
|
|
+ User.savePadNo("")
|
|
|
+ User.saveToken("")
|
|
|
+ JumpUtil.jumpActivity(RouterUrlCommon.login)
|
|
|
} else {
|
|
|
loge("onNext--Failure--code:" + tBaseEntity.code + "--Message:" + tBaseEntity.message)
|
|
|
onFail(tBaseEntity.message)
|