Commit 23dac15b authored by 李晓静's avatar 李晓静

优化url后参数

parent b5260b7a
......@@ -276,7 +276,11 @@ export default class DataView extends React.Component {
onChange: (nextPage) => {
this.fetchPage(nextPage);
this.fetch();
window.history.replaceState({ pageNum: nextPage }, '', `?pageNum=${nextPage}`);
window.history.replaceState(
{ pageNum: nextPage },
'',
`${window.location.search && window.location.search.indexOf('?pageNum') < 0 ? `${window.location.search}&` : '?'}pageNum=${nextPage}`,
);
},
onShowSizeChange: this.fetchPageSize,
showQuickJumper: true,
......@@ -423,7 +427,7 @@ export default class DataView extends React.Component {
message.success('操作成功');
}
fetch() {
fetch = () => {
const { beforeFetch, fetch, afterFetch } = this.props;
let onBeforeFetch = beforeFetch;
if (typeof onBeforeFetch !== 'function') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment