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