From f81779b1391c19b603d74e47c3604ea1749ba029 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 03 四月 2025 11:27:50 +0800 Subject: [PATCH] 2025-04-03 --- src/api/index.js | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 2b7208c..83a8993 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -60,10 +60,12 @@ localStorage.removeItem('role_id') localStorage.removeItem('mk_user_type') - sessionStorage.clear() - if (!!(window.history && window.history.pushState)) { - window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login') - window.location.reload() + if (!/#\/login/.test(window.location.href)) { + sessionStorage.clear() + if (!!(window.history && window.history.pushState)) { + window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login') + window.location.reload() + } } } }) -- Gitblit v1.8.0