From 601a03b5b484bfc4e904e6087be33532cd85737e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=96=8C?= <892728595@qq.com> Date: Sun, 10 Sep 2017 02:26:27 +0800 Subject: [PATCH 1/2] fix bug#575 --- src/models/app.js | 4 ++-- src/routes/post/index.js | 9 +++++---- src/routes/user/index.js | 12 ++++++------ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/models/app.js b/src/models/app.js index 7a205a5..711b13f 100644 --- a/src/models/app.js +++ b/src/models/app.js @@ -99,9 +99,9 @@ export default { } else if (config.openPages && config.openPages.indexOf(locationPathname) < 0) { yield put(routerRedux.push({ pathname: '/login', - query: { + search: queryString.stringify({ from: locationPathname, - }, + }), })) } }, diff --git a/src/routes/post/index.js b/src/routes/post/index.js index 40be20d..b30af7e 100644 --- a/src/routes/post/index.js +++ b/src/routes/post/index.js @@ -4,6 +4,7 @@ import { connect } from 'dva' import { Tabs } from 'antd' import { routerRedux } from 'dva/router' import List from './List' +import queryString from 'query-string' const TabPane = Tabs.TabPane @@ -24,11 +25,11 @@ const Index = ({ post, dispatch, loading, location }) => { onChange (page) { dispatch(routerRedux.push({ pathname, - query: { + search: queryString.stringify({ ...query, page: page.current, pageSize: page.pageSize, - }, + }), })) }, } @@ -36,9 +37,9 @@ const Index = ({ post, dispatch, loading, location }) => { const handleTabClick = (key) => { dispatch(routerRedux.push({ pathname, - query: { + search: queryString.stringify({ status: key, - }, + }), })) } diff --git a/src/routes/user/index.js b/src/routes/user/index.js index 696d180..7758d7b 100644 --- a/src/routes/user/index.js +++ b/src/routes/user/index.js @@ -45,11 +45,11 @@ const User = ({ location, dispatch, user, loading }) => { const { query, pathname } = location dispatch(routerRedux.push({ pathname, - query: { + search: queryString.stringify({ ...query, page: page.current, pageSize: page.pageSize, - }, + }), })) }, onDeleteItem (id) { @@ -88,20 +88,20 @@ const User = ({ location, dispatch, user, loading }) => { onFilterChange (value) { dispatch(routerRedux.push({ pathname: location.pathname, - query: { + search: queryString.stringify({ ...value, page: 1, pageSize, - }, + }), })) }, onSearch (fieldsValue) { fieldsValue.keyword.length ? dispatch(routerRedux.push({ pathname: '/user', - query: { + search: queryString.stringify({ field: fieldsValue.field, keyword: fieldsValue.keyword, - }, + }), })) : dispatch(routerRedux.push({ pathname: '/user', })) From 322d5a6d0ec6c631e9a849a01ee192e100261dfe Mon Sep 17 00:00:00 2001 From: zuiidea Date: Mon, 11 Sep 2017 09:35:09 +0800 Subject: [PATCH 2/2] merge #576 --- package.json | 2 +- src/routes/post/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3c41117..e041d65 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "antd-admin", - "version": "4.3.5", + "version": "4.3.6", "dependencies": { "antd": "^2.11.2", "axios": "^0.16.2", diff --git a/src/routes/post/index.js b/src/routes/post/index.js index b30af7e..4046f99 100644 --- a/src/routes/post/index.js +++ b/src/routes/post/index.js @@ -3,8 +3,8 @@ import PropTypes from 'prop-types' import { connect } from 'dva' import { Tabs } from 'antd' import { routerRedux } from 'dva/router' -import List from './List' import queryString from 'query-string' +import List from './List' const TabPane = Tabs.TabPane