From 42fae277ae5ebe794fc070bf38482a919eb661fc Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 25 十一月 2020 14:36:02 +0800 Subject: [PATCH] 2020-11-25 --- src/api/index.js | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 8d1b215..b6024f5 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -56,7 +56,7 @@ return Promise.reject(error) }) -const setCurrentUrl = () => { +const setCurrentUrl = (res) => { if (!!(window.history && window.history.pushState)) { if (window.location.href.indexOf('paramsmain') > -1) { let _href = window.location.href.split('#') @@ -64,6 +64,7 @@ } sessionStorage.clear() + sessionStorage.setItem('loginError', JSON.stringify({request: res.config ? res.config.data : '', response: JSON.stringify(res.data)})) window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login') window.location.reload() } @@ -77,7 +78,7 @@ response.data.ErrCode = 'E' return Promise.resolve(response.data) } else { - setCurrentUrl() + setCurrentUrl(response) } } else { return Promise.resolve(response.data) -- Gitblit v1.8.0