ソースを参照

Merge branch 'master' of https://gitee.com/anji-plus/report

qianlishi 4 年 前
コミット
1c299a6aac
1 ファイル変更4 行追加5 行削除
  1. 4 5
      report-ui/src/utils/request.js

+ 4 - 5
report-ui/src/utils/request.js

@@ -1,6 +1,7 @@
 import axios from 'axios'
 import { Message, MessageBox } from 'element-ui'
 import store from '../store'
+import { delItem } from "@/utils/storage"
 import { getToken } from '@/utils/auth'
 // 创建axios实例
 const service = axios.create({
@@ -38,11 +39,9 @@ service.interceptors.response.use(
           type: 'warning'
         }
       ).then(() => {
-        // store.dispatch('FedLogOut').then(() => {
-        //   // location.reload() // 为了重新实例化vue-router对象 避免bug
-        //   window.location.href = "/";
-        // })
-        location.reload();
+        delItem('token')
+        sessionStorage.clear()
+        localStorage.clear()
         window.location.href = "/";
       })
     }