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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
2 deletions
-
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), |
|
|
|
|