We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
配置以下的restful api结构, 永远只会返回数组里面的第一个, 即使我用的method是 get, 它也只会返回第一个.
我看了下代码
https://github.com/anncwb/vite-plugin-mock/blob/4474a2e3c91b45bf1535ca3c93bddf6b2a79b7b7/src/createMockServer.ts#L44
应该不是我使用的不对, 程序里面好像没有判断呢
[ { url: '/admin-api/api-permission', timeout: 1000, method: 'post', response: () => { return resultSuccess({}); }, }, { url: '/admin-api/api-permission', timeout: 1000, method: 'get', response: ({ query }) => { const { page = 1, pageSize = 20 } = query; return resultPageSuccess(page, pageSize, apiPermissionList); }, }, ] as MockMethod[]; ` # 版本 v2.2.1
The text was updated successfully, but these errors were encountered:
https://github.com/anncwb/vite-plugin-mock/blob/4474a2e3c91b45bf1535ca3c93bddf6b2a79b7b7/src/createMockServer.ts#L60
这行代码下面还是需要加一个判断, 如果method不相同就直接返回false
if(item.method.toUpperCase() !== req.method) return false;
Sorry, something went wrong.
很好奇你为什么会写一样的api。这个在后台好像也是不能写的
efe943d
莫非我对restful api理解的有问题 😭
post /admin-api/api-permission 添加一条api权限 get '/admin-api/api-permission' 获取所有权限列表
No branches or pull requests
问题描述
配置以下的restful api结构, 永远只会返回数组里面的第一个, 即使我用的method是 get, 它也只会返回第一个.
我看了下代码
https://github.com/anncwb/vite-plugin-mock/blob/4474a2e3c91b45bf1535ca3c93bddf6b2a79b7b7/src/createMockServer.ts#L44
应该不是我使用的不对, 程序里面好像没有判断呢
The text was updated successfully, but these errors were encountered: