Browse Source

Remove deprecated `url.parse` (#8542)

This API is deprecated. Changed to WHATWG URL API using `new URLSearchParams`
v4
Jiahao 5 years ago
committed by GitHub
parent
commit
09ca467444
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      mock/listTableList.ts

3
mock/listTableList.ts

@ -1,6 +1,5 @@
// eslint-disable-next-line import/no-extraneous-dependencies
import { Request, Response } from 'express';
import { parse } from 'url';
import { TableListItem, TableListParams } from '@/pages/TableList/data';
// mock tableListDataSource
@ -39,7 +38,7 @@ function getRule(req: Request, res: Response, u: string) {
realUrl = req.url;
}
const { current = 1, pageSize = 10 } = req.query;
const params = (parse(realUrl, true).query as unknown) as TableListParams;
const params = (new URLSearchParams(realUrl.split('?')[1]) as unknown) as TableListParams;
let dataSource = [...tableListDataSource].slice(
((current as number) - 1) * (pageSize as number),

Loading…
Cancel
Save