提交 e4d32131 编写于 作者: KK's avatar KK

Revert "mock 数据调整"

This reverts commit 77cce633.
上级 77cce633
...@@ -421,16 +421,16 @@ mock.on${reqMtd?lower_case?cap_first}(new RegExp(/^${fullPath}\/fetch<#if (deds. ...@@ -421,16 +421,16 @@ mock.on${reqMtd?lower_case?cap_first}(new RegExp(/^${fullPath}\/fetch<#if (deds.
let { headers } = config; let { headers } = config;
let xTotal = mockDatas.length; let xTotal = mockDatas.length;
let records:any; let records: Array<any> = [];
if (config.url.includes('page')) { if (config.url.includes('page')) {
let url = config.url; let url = config.url;
let xPage = url.split('page=')[1]; let xPage = url.split('page=')[1];
let xPerPage = url.split('size=')[1].split('&')[0]; let xPerPage = url.split('size=')[1].split('&')[0];
Object.assign(headers, { 'x-page': xPage + '', 'x-per-page': xPerPage + '', 'x-total': xTotal + '' }); Object.assign(headers, { 'x-page': xPage + '', 'x-per-page': xPerPage + '', 'x-total': xTotal + '' });
let start = xTotal - (xPage * xPerPage); let start = xTotal - (xPage * xPerPage);
records = {records:mockDatas.slice(xPage * xPerPage, xPerPage)}; records = mockDatas.slice(xPage * xPerPage, xPerPage);
} else { } else {
records = {records:[...mockDatas]}; records = [...mockDatas];
} }
return [status, records, config.headers, config]; return [status, records, config.headers, config];
}); });
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册