From 93eb6650f02a734e91584c7cacad6aea8fcf6a31 Mon Sep 17 00:00:00 2001 From: zhouwenxuan <1175765986@qq.com> Date: 星期二, 05 十二月 2023 09:22:47 +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