|
|
@@ -1,7 +1,7 @@ |
|
|
|
/* |
|
|
|
* @Date: 2021-12-08 15:59:46 |
|
|
|
* @LastEditors: JinxChen |
|
|
|
* @LastEditTime: 2022-01-12 09:18:37 |
|
|
|
* @LastEditTime: 2022-01-12 09:31:21 |
|
|
|
* @FilePath: \GpsCardAdmin\src\utils\request.js |
|
|
|
* @description: |
|
|
|
*/ |
|
|
@@ -68,14 +68,14 @@ service.interceptors.response.use( |
|
|
|
setTimeout(() => { |
|
|
|
store.dispatch('user/resetToken').then(() => { |
|
|
|
Message({ |
|
|
|
message: 'token过期,请重新登录', |
|
|
|
message: '登录过期,请您重新登录!', |
|
|
|
type: 'error', |
|
|
|
duration: 1500 |
|
|
|
}) |
|
|
|
location.reload() |
|
|
|
}) |
|
|
|
}, 1500) |
|
|
|
return Promise.reject(new Error('token过期,请重新登录')) |
|
|
|
}, 1000) |
|
|
|
/* return Promise.reject(new Error('token过期,请重新登录')) */ |
|
|
|
} else if (res.code === 0) { |
|
|
|
return res |
|
|
|
} else { |
|
|
@@ -88,7 +88,7 @@ service.interceptors.response.use( |
|
|
|
} |
|
|
|
}, |
|
|
|
error => { |
|
|
|
console.log('err' + error) // for debug |
|
|
|
console.log('err:', error) // for debug |
|
|
|
Message({ |
|
|
|
message: error.message, |
|
|
|
type: 'error', |
|
|
|