Skip to content
New issue

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

动态接口params取值 #7

Closed
lh0070 opened this issue Mar 10, 2021 · 5 comments
Closed

动态接口params取值 #7

lh0070 opened this issue Mar 10, 2021 · 5 comments

Comments

@lh0070
Copy link

lh0070 commented Mar 10, 2021

https://github.com/anncwb/vite-plugin-mock/blob/b1298b1502e4126b6e98cd07a878cb70df355a8d/src/createMockServer.ts#L76-L78

动态接口/api/:id 我想取id的值,这行代码判断有问题,取不到值

@anncwb
Copy link
Collaborator

anncwb commented Mar 10, 2021

除了:id 你还有在params内携带参数吗

@lh0070
Copy link
Author

lh0070 commented Mar 10, 2021

这个接口没有传query,只有id这个参数,取不到

@anncwb
Copy link
Collaborator

anncwb commented Mar 10, 2021

插件版本号,请求是get还是post 都发一下

@lh0070
Copy link
Author

lh0070 commented Mar 10, 2021

2.2.3 post

@anncwb anncwb closed this as completed in 70b51e8 Mar 10, 2021
@anncwb
Copy link
Collaborator

anncwb commented Mar 10, 2021

升级到2.2.4,post风格的restful接口也用query取params

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants