From ca29a54a8e883a0aed528fc27627e109b4fc4467 Mon Sep 17 00:00:00 2001
From: 马宇豪 <978517621@qq.com>
Date: 星期一, 04 十二月 2023 09:33:20 +0800
Subject: [PATCH] 新增

---
 src/utils/request.js |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/utils/request.js b/src/utils/request.js
index 39cb883..6664bbb 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -6,7 +6,7 @@
 import cache from '@/plugins/cache'
 import { saveAs } from 'file-saver'
 import useUserStore from '@/store/modules/user'
-
+import router from '../router'
 let downloadLoadingInstance;
 // 是否显示重新登录
 export let isRelogin = { show: false };
@@ -27,7 +27,7 @@
   // 是否需要防止数据重复提交
   const isRepeatSubmit = (config.headers || {}).repeatSubmit === false
   if (getToken() && !isToken) {
-    config.headers['Authorization'] = 'Bearer ' + getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
+    config.headers['Authorization'] =  getToken() // 让每个请求携带自定义token 请根据实际情况自行修改
   }
   // get请求映射params参数
   if (config.method === 'get' && config.params) {
@@ -88,7 +88,9 @@
           ElMessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => {
             isRelogin.show = false;
             useUserStore().logOut().then(() => {
-              location.href = '/index';
+              // router.push('/homePage')
+
+              location.href = '/homePage';
             })
           }).catch(() => {
             isRelogin.show = false

--
Gitblit v1.9.2