1
0
mirror of https://github.com/fumiama/paper-manager.git synced 2026-06-23 03:50:33 +08:00

optimize vben/mock

This commit is contained in:
源文雨
2023-03-11 18:07:45 +08:00
parent a42e2f450b
commit 47e9935c88
9 changed files with 155 additions and 155 deletions

View File

@@ -1,5 +1,5 @@
import { MockMethod } from 'vite-plugin-mock';
import { resultSuccess } from '../_util';
import { MockMethod } from 'vite-plugin-mock'
import { resultSuccess } from '../_util'
const areaList: any[] = [
{
@@ -308,18 +308,18 @@ const areaList: any[] = [
customized: false,
usable: true,
},
];
]
export default [
{
url: '/basic-api/cascader/getAreaRecord',
timeout: 1000,
method: 'post',
response: ({ body }) => {
const { parentCode } = body || {};
const { parentCode } = body || {}
if (!parentCode) {
return resultSuccess(areaList.filter((it) => it.code === '430000'));
return resultSuccess(areaList.filter((it) => it.code === '430000'))
}
return resultSuccess(areaList.filter((it) => it.parentCode === parentCode));
return resultSuccess(areaList.filter((it) => it.parentCode === parentCode))
},
},
] as MockMethod[];
] as MockMethod[]