|
@@ -52,6 +52,7 @@ async response => {
|
|
|
*/
|
|
|
|
|
|
const res = response.data
|
|
|
+
|
|
|
if (res.code !== 200) {
|
|
|
Message({
|
|
|
message: res.msg||res.message,
|
|
@@ -61,12 +62,20 @@ async response => {
|
|
|
|
|
|
// 401:未登录;
|
|
|
if (res.code === 401 || res.code === 403) {
|
|
|
+ console.log(location,'401/403')
|
|
|
// 清理缓存 跳到登录页面
|
|
|
- await store.dispatch('FedLogOut')
|
|
|
- await router.push('/login')
|
|
|
- setTimeout(()=>{
|
|
|
- location.reload()
|
|
|
- },500)
|
|
|
+ try{
|
|
|
+ await store.dispatch('FedLogOut')
|
|
|
+ await router.push('/login')
|
|
|
+ setTimeout(() => {
|
|
|
+ console.log('调用刷新前401/403')
|
|
|
+ location.reload()
|
|
|
+ }, 500);
|
|
|
+
|
|
|
+ }catch(e){
|
|
|
+ console.log(e,'报错')
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
// location = window.location.origin;
|