From 1bc3af31066268415b431f035c87d82aa321dc01 Mon Sep 17 00:00:00 2001 From: zhuo <2089219845@qq.com> Date: 星期六, 15 三月 2025 09:57:28 +0800 Subject: [PATCH] 单点登录调整 --- src/store/modules/user.js | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 1fc3208..b02eb61 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -113,12 +113,16 @@ LogOut({ commit, state }) { return new Promise((resolve, reject) => { logout(state.token) - .then(() => { - commit("SET_TOKEN", ""); - commit("SET_ROLES", []); - commit("SET_PERMISSIONS", []); - removeToken(); - resolve(); + .then((res) => { + if (res.data) { + window.location.href = res.data + } else { + commit("SET_TOKEN", ""); + commit("SET_ROLES", []); + commit("SET_PERMISSIONS", []); + removeToken(); + resolve(); + } }) .catch((error) => { reject(error); -- Gitblit v1.9.3