-
Notifications
You must be signed in to change notification settings - Fork 112
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
fix: 查询参数为数组时需要将数组转为字符串形式 #314
Merged
levy9527
merged 3 commits into
FEMessage:dev
from
zenghao1203:fix-search-multi-select-query
Jul 23, 2020
Merged
fix: 查询参数为数组时需要将数组转为字符串形式 #314
levy9527
merged 3 commits into
FEMessage:dev
from
zenghao1203:fix-search-multi-select-query
Jul 23, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Deploy preview for el-data-table ready! Built with commit 8f6560b |
之前有个 pr 为了解决参数为数组时刷新不丢失的问题,存放 url 的时候特地保留数组的形式,以便正常 decode。 |
gd4Ark
reviewed
Jul 23, 2020
gd4Ark
approved these changes
Jul 23, 2020
gd4Ark
approved these changes
Jul 23, 2020
levy9527
approved these changes
Jul 23, 2020
@all-contributors add @zenghao1203 bug |
I've put up a pull request to add @zenghao1203! 🎉 |
这段代码修改了axios请求的默认行为
HTTP协议中是允许同样名称的参数出现多次。 参考资料: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why
当查询参数为数组时,需要将参数转化为字符串。因为在发送请求时,数组参数会被处理;列如:
在大多数项目中已使用数组参数,都转化为了字符串的形式。会导致查询接口报错。
How
只需在处理query参数时,加上一个判断,如果是使用的数组,那么将数组转化为字符串即可
Test
before
after