Explorar el Código

Update login.js (#4103)

解决在组件componentDidMount()方法中调用多个接口失败时(如:401情况)返回登录界面的query string 中会递归叠加多个redirect参数的问题;解决代码导致 lint 挂了的问题。
JerryYu2014 hace 6 años
padre
commit
a6fee6b72b
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      src/models/login.js

+ 2 - 1
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',