From e42c21f0eb5fb69f2a937099d07384598adcab81 Mon Sep 17 00:00:00 2001 From: zuiidea Date: Mon, 11 Sep 2017 09:53:22 +0800 Subject: [PATCH] fix #574 --- src/routes/post/index.js | 9 ++++----- src/routes/user/index.js | 12 ++++++------ 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/routes/post/index.js b/src/routes/post/index.js index 4046f99..40be20d 100644 --- a/src/routes/post/index.js +++ b/src/routes/post/index.js @@ -3,7 +3,6 @@ import PropTypes from 'prop-types' import { connect } from 'dva' import { Tabs } from 'antd' import { routerRedux } from 'dva/router' -import queryString from 'query-string' import List from './List' const TabPane = Tabs.TabPane @@ -25,11 +24,11 @@ const Index = ({ post, dispatch, loading, location }) => { onChange (page) { dispatch(routerRedux.push({ pathname, - search: queryString.stringify({ + query: { ...query, page: page.current, pageSize: page.pageSize, - }), + }, })) }, } @@ -37,9 +36,9 @@ const Index = ({ post, dispatch, loading, location }) => { const handleTabClick = (key) => { dispatch(routerRedux.push({ pathname, - search: queryString.stringify({ + query: { status: key, - }), + }, })) } diff --git a/src/routes/user/index.js b/src/routes/user/index.js index 7758d7b..696d180 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, - search: queryString.stringify({ + query: { ...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, - search: queryString.stringify({ + query: { ...value, page: 1, pageSize, - }), + }, })) }, onSearch (fieldsValue) { fieldsValue.keyword.length ? dispatch(routerRedux.push({ pathname: '/user', - search: queryString.stringify({ + query: { field: fieldsValue.field, keyword: fieldsValue.keyword, - }), + }, })) : dispatch(routerRedux.push({ pathname: '/user', }))