mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat(projects): 添加请求适配器的请求示例
This commit is contained in:
20
mock/api/demo.ts
Normal file
20
mock/api/demo.ts
Normal 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;
|
Reference in New Issue
Block a user