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

ctx.query 解析与express v4 的差别 #2162

Closed
SmartOrange opened this issue Jul 28, 2022 · 7 comments
Closed

ctx.query 解析与express v4 的差别 #2162

SmartOrange opened this issue Jul 28, 2022 · 7 comments

Comments

@SmartOrange
Copy link
Contributor

类似一下 url
http://127.0.0.1:7001?mixFlowInstIds%5B%5D=108015365&flowInstIds%5B%5D=103137222

express 解析:
image

midway:
image

@waitingsong
Copy link
Member

express 和 php 差不多,传递 数组字段名。 midway 默认是直接识别为字段名,然后重名的覆盖(可以设置为解析为数组)

@kurten
Copy link
Contributor

kurten commented Aug 6, 2022

依赖库的处理逻辑上有差异,我看看能不能抽象一下可配直化的逻辑出来

@czy88840616
Copy link
Member

我让觅九提的...不要慌

@kurten
Copy link
Contributor

kurten commented Aug 6, 2022

我让觅九提的...不要慌

好吧,其实替换一下 koa request 中的 query parse 就行了,不过就是比较麻烦。
qs 这个是支持这类复杂query参数处理的。

@czy88840616
Copy link
Member

koa 我看是正确的,不正确的是 egg 吧。。

@czy88840616
Copy link
Member

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

4 participants