|
|
@@ -41,13 +41,17 @@ const request = config => {
|
|
|
const code = res.data.code || 200
|
|
|
const msg = errorCode[code] || res.data.msg || errorCode['default']
|
|
|
if (code === 401) {
|
|
|
- uni.reLaunch({ url: '/' })
|
|
|
- // showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
|
|
|
- // if (res.confirm) {
|
|
|
- // uni.reLaunch({ url: '/' })
|
|
|
- // }
|
|
|
- // })
|
|
|
- reject('无效的会话,或者会话已过期,请重新登录。')
|
|
|
+ store.dispatch('LogOut').then(res => {
|
|
|
+ uni.reLaunch({ url: '/' })
|
|
|
+ })
|
|
|
+ // showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
|
|
|
+ // if (res.confirm) {
|
|
|
+ // store.dispatch('LogOut').then(res => {
|
|
|
+ // uni.reLaunch({ url: '/pages/login' })
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ reject('无效的会话,或者会话已过期,请重新登录。')
|
|
|
} else if (code === 500) {
|
|
|
toast(msg)
|
|
|
reject('500')
|
|
|
@@ -73,3 +77,4 @@ const request = config => {
|
|
|
}
|
|
|
|
|
|
export default request
|
|
|
+
|