|
@@ -56,14 +56,14 @@ service.interceptors.response.use(
|
|
|
|
|
|
|
|
// 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
|
|
// 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired;
|
|
|
if (res.code === 401) {
|
|
if (res.code === 401) {
|
|
|
- // to re-login
|
|
|
|
|
- Message({
|
|
|
|
|
- message: '请重新登录',
|
|
|
|
|
- type: 'error',
|
|
|
|
|
- duration: 3 * 1000
|
|
|
|
|
- })
|
|
|
|
|
- store.dispatch('user/resetToken').then(() => {
|
|
|
|
|
- location.reload()
|
|
|
|
|
|
|
+ MessageBox.confirm('请重新登录', {
|
|
|
|
|
+ confirmButtonText: '重新登录',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'warning'
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ store.dispatch('user/resetToken').then(() => {
|
|
|
|
|
+ location.reload()
|
|
|
|
|
+ })
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
return Promise.reject(new Error(res.msg || 'Error'))
|
|
return Promise.reject(new Error(res.msg || 'Error'))
|