首页 > 其他 > 详细

vue——put请求设置header后无效问题解决

时间:2020-05-20 18:20:00      阅读:201      评论:0      收藏:0      [点我收藏+]

原:

···
let config = { headers: { "Content-Type": "application/json", "token": localStorage.getItem("token") } } this.$axios.put(‘***‘ ,config).then(function (res) { ··· })
···

 

改:

···
let config = {
    headers: {
          "Content-Type": "application/json",
          "token": localStorage.getItem("token")
    }
}

this.$axios.put(‘***‘ ,‘‘,config).then(function (res) {  // <= 关键,在url和config中插入一个空字符参数
    ···
})
···

 

vue——put请求设置header后无效问题解决

原文:https://www.cnblogs.com/linjiangxian/p/12924946.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!