|
@@ -53,24 +53,40 @@ const request = config => {
|
|
|
if (code === 401) {
|
|
|
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
|
|
|
if (res.confirm) {
|
|
|
- if (cacheManager.get('auth')) {
|
|
|
+ const auth = cacheManager.get('auth')
|
|
|
+ if (auth) {
|
|
|
cacheManager.clearAll()
|
|
|
}
|
|
|
- uni.reLaunch({
|
|
|
- url: '/pages/Login/index'
|
|
|
- })
|
|
|
+ if (auth.type == 2) {
|
|
|
+ uni.reLaunch({
|
|
|
+ url: '/pages/Login/index'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.reLaunch({
|
|
|
+ url: '/pages/Login/clientIndex'
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
})
|
|
|
reject('无效的会话,或者会话已过期,请重新登录。')
|
|
|
} else if (code === 405) {
|
|
|
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
|
|
|
if (res.confirm) {
|
|
|
- if (cacheManager.get('auth')) {
|
|
|
+ const auth = cacheManager.get('auth')
|
|
|
+ if (auth) {
|
|
|
cacheManager.clearAll()
|
|
|
}
|
|
|
- uni.reLaunch({
|
|
|
- url: '/pages/Login/index'
|
|
|
- })
|
|
|
+ if (auth.type == 2) {
|
|
|
+ uni.reLaunch({
|
|
|
+ url: '/pages/Login/index'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.reLaunch({
|
|
|
+ url: '/pages/Login/clientIndex'
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
})
|