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
return JSON.parse('{"' + decodeURIComponent(search).replace(/"/g, '\"').replace(/&/g, '","').replace(/=/g, '":"') + '"}')
decodeURIComponent 过早了吧, & , = 特殊字符 JSON.parse 之后 枚举处理吧
The text was updated successfully, but these errors were encountered:
这里replace的本意,是将解码后的url查询字符串中的&,=等特殊字符串替换,拼接成一个类似的JSON字符串,然后再通过JSON.parse()方法转换为一个参数对象,不存在上述问题。
replace
url
&
=
JSON
JSON.parse()
Sorry, something went wrong.
encodeURIComponent('&') = '%26' parseQueryString('www.baidu.com?a=123&b=%26') make try
🌹 感谢你的细心,已在最新版本中更正了这个错误。
No branches or pull requests
return JSON.parse('{"' + decodeURIComponent(search).replace(/"/g, '\"').replace(/&/g, '","').replace(/=/g, '":"') + '"}')
decodeURIComponent 过早了吧,
& , = 特殊字符
JSON.parse 之后 枚举处理吧
The text was updated successfully, but these errors were encountered: