axios的post请求返回状态码400

时间:2020-05-14 22:43:19   收藏:0   阅读:345

设置拦截

axios.interceptors.request.use((config) => {
  if (config.method === ‘post‘) {
    if (!config.isFormData) {
      config.data = qs.stringify(config.data,{ indices: false })
    }
  }

  return config
}, (err) => {
  return Promise.reject(err)
})

 

原文:https://www.cnblogs.com/learninginto/p/12891590.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!