Skip to content

Commit

Permalink
fix: 修复mock接口无法请求错误
Browse files Browse the repository at this point in the history
  • Loading branch information
yuntian001 committed Jan 9, 2023
1 parent c5e03cc commit ade3830
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mock/apiDemo/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ const list = [
export default [
{
url: '/api/demo', //
method: 'GET',
method: 'get',
timeout: 500 + Math.floor(Math.random() * 300),
response: (req: { query: any }) => {
const query = req.query;
Expand Down Expand Up @@ -358,7 +358,7 @@ export default [
},
{
url: '/api/demo', //新增
method: 'POST',
method: 'post',
timeout: 500 + Math.floor(Math.random() * 300),
response: (req: { body: any }) => {
list.push(
Expand All @@ -372,7 +372,7 @@ export default [
},
{
url: /\/api\/demo\/[0-9]+/, //编辑
method: 'PUT',
method: 'put',
timeout: 500 + Math.floor(Math.random() * 300),
response: (req: { url: string; body: any }) => {
const id = req.url.replace('/api/demo/', '');
Expand All @@ -386,7 +386,7 @@ export default [
},
{
url: /\/api\/demo\/[0-9]+/, //删除
method: 'DELETE',
method: 'delete',
timeout: 500 + Math.floor(Math.random() * 300),
response: (req: { url: string }) => {
const id = req.url.replace('/api/demo/', '');
Expand Down

0 comments on commit ade3830

Please sign in to comment.