feat(projects): 添加请求适配器的请求示例

This commit is contained in:
Soybean
2022-04-04 19:13:15 +08:00
parent 6bed9ead38
commit bed4292ed3
8 changed files with 63 additions and 38 deletions

20
mock/api/demo.ts Normal file
View File

@ -0,0 +1,20 @@
import type { MockMethod } from 'vite-plugin-mock';
const apis: MockMethod[] = [
{
url: '/mock/apiDemoWithAdapter',
method: 'post',
response: (): Service.MockServiceResult<ApiDemo.DataWithAdapter> => {
return {
code: 200,
message: 'ok',
data: {
dataId: '123',
dataName: 'demoName'
}
};
}
}
];
export default apis;