Преглед изворни кода

非使用字符串的地方 使用 push(location: LocationDescriptor, state?: LocationState)

yoyo837 пре 7 година
родитељ
комит
d13c8811b4
1 измењених фајлова са 7 додато и 5 уклоњено
  1. 7 5
      src/models/login.js

+ 7 - 5
src/models/login.js

@@ -1,8 +1,9 @@
 import { routerRedux } from 'dva/router';
+import { stringify } from 'qs';
 import { fakeAccountLogin } from '../services/api';
 import { setAuthority } from '../utils/authority';
 import { reloadAuthorized } from '../utils/Authorized';
-import { getPageQuery, getQueryPath } from '../utils/utils';
+import { getPageQuery } from '../utils/utils';
 
 export default {
   namespace: 'login',
@@ -49,11 +50,12 @@ export default {
       });
       reloadAuthorized();
       yield put(
-        routerRedux.push(
-          getQueryPath('/user/login', {
+        routerRedux.push({
+          pathname: '/user/login',
+          search: stringify({
             redirect: window.location.href,
-          })
-        )
+          }),
+        })
       );
     },
   },