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
问题分析可以参考:axios/axios#1111
解决方案:
import qs from 'qs'; axios.defaults.paramsSerializer: function(params) { return qs.stringify(params, { indices: false }); // param=value1¶m=value2 }
或者
service.interceptors.request.use(config => { let url = config.url if (config.method === 'get' && config.params) { url += '?' // 拼接参数 // 获取所有参数,通过循环 拼接所有参数,encodeURIComponent对参数编码, Object.keys(config.params).map(key => { url += `${key}=${encodeURIComponent(config.params[key])}&` }) url = url.substring(0, url.length - 1) // 删除最后一个&字符 config.params = {} // 参数已经存在于 url中 } config.url = url return config }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
问题分析可以参考:axios/axios#1111
解决方案:
或者
The text was updated successfully, but these errors were encountered: