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

2024年3月28日,get参数中有数组时,参数传递失败 #2170

Open
wslz opened this issue Mar 28, 2024 · 3 comments
Open

2024年3月28日,get参数中有数组时,参数传递失败 #2170

wslz opened this issue Mar 28, 2024 · 3 comments

Comments

@wslz
Copy link

wslz commented Mar 28, 2024

直接从浏览器复制链接到runapi,当url包含数组时,runapi与浏览器的解析不一致,如图:
请求参数:/customerTriag/enumList?_debug=1&more%5B%5D=create_account_job&more%5B%5D=create_account_sales_group
runapi截图:
image
runapi请求日志:
192.168.90.9 - - [28/Mar/2024:10:38:41 +0800] "GET /customerTriag/enumList?_debug=1&more%5B%5D=create_account_sales_group HTTP/1.1" 200 97 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) runapi/3.0.7 Chrome/108.0.5359.215 Electron/22.3.2 Safari/537.36"
浏览器请求日志:
192.168.90.9 - - [28/Mar/2024:10:41:28 +0800] "GET /customerTriag/enumList?_debug=1&more%5B%5D=create_account_job&more%5B%5D=create_account_sales_group HTTP/1.1" 200 97 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"

谢谢

@star7th
Copy link
Owner

star7th commented Mar 28, 2024

url是字符串,不支持包含数组。你这样设计接口也是不合理的,说不定在某些平台会遇到兼容问题。需要在url传递数组的情况一般都是合并为一个参数,然后逗号切割。
比如 more=aaaaa,bbbbb,ccccc

@star7th
Copy link
Owner

star7th commented Mar 28, 2024

前后端在处理参数的合并以及分解逗号字符串为需要的数组即可

@wslz
Copy link
Author

wslz commented Mar 28, 2024

好吧 只是个人还是觉得应该是它适应浏览器

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