From 5d46dd961e2599cacb45de7f3f8d59fdeafc897d Mon Sep 17 00:00:00 2001 From: donghaolin <17667510818@163.com> Date: Mon, 10 Mar 2025 14:42:17 +0800 Subject: [PATCH] =?UTF-8?q?token=E8=BF=87=E6=9C=9F=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E3=80=81=E6=9D=83=E9=99=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gold-system/src/util/http.js | 2 +- gold-system/src/views/index.vue | 38 +++++++++--- gold-system/src/views/login.vue | 19 +++++- gold-system/src/views/workspace/index.vue | 96 ++++++++++++------------------- 4 files changed, 88 insertions(+), 67 deletions(-) diff --git a/gold-system/src/util/http.js b/gold-system/src/util/http.js index 48e95c6..5672500 100644 --- a/gold-system/src/util/http.js +++ b/gold-system/src/util/http.js @@ -34,7 +34,7 @@ export default function (options) { // 清除localStorage中的token localStorage.removeItem('token'); // // 执行重新登录的逻辑,例如跳转到登录页面 - window.location.href = '/login'; + window.location.href = '/jtzy/Product/crm/hwjb2.0/index.html#/login'; // 可以在这里返回一个特定的值或者对象,以便调用者知道需要重新登录 return { needsLogin: true }; } else { diff --git a/gold-system/src/views/index.vue b/gold-system/src/views/index.vue index dd16b34..88d5b93 100644 --- a/gold-system/src/views/index.vue +++ b/gold-system/src/views/index.vue @@ -46,6 +46,8 @@ function logout() { localStorage.removeItem("token"); localStorage.clear(); router.push("/login"); + //添加刷新页面的代码 + window.location.reload(); ElMessage.success("退出成功"); } @@ -82,7 +84,8 @@ onMounted(async function () { v-if=" adminData.permission == 1 || adminData.permission == 2 || - adminData.permission == 3 + adminData.permission == 3 || + adminData.permission == 5 " > @@ -93,7 +96,11 @@ onMounted(async function () {