From a6fee6b72b0e9b6fae15d01068314d52070d94c9 Mon Sep 17 00:00:00 2001 From: JerryYu2014 <648542313@qq.com> Date: Sun, 28 Apr 2019 20:02:39 +0800 Subject: [PATCH] Update login.js (#4103) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 解决在组件componentDidMount()方法中调用多个接口失败时(如:401情况)返回登录界面的query string 中会递归叠加多个redirect参数的问题;解决代码导致 lint 挂了的问题。 --- src/models/login.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/models/login.js b/src/models/login.js index b5d226aa..5d129e17 100644 --- a/src/models/login.js +++ b/src/models/login.js @@ -53,8 +53,9 @@ export default { }, }); reloadAuthorized(); + const { redirect } = getPageQuery(); // redirect - if (window.location.pathname !== '/user/login') { + if (window.location.pathname !== '/user/login' && !redirect) { yield put( routerRedux.replace({ pathname: '/user/login', -- GitLab