卡色螺旋式 2022-03-21 09:14 采纳率: 0%
浏览 1705

vue post请求 403(forbidden)

做后台管理系统需要上传文件和图片,但是发送post请求确实403
//上传图片
upimage:function(e){
const file = this.$refs.fileInt.files[0];
console.log(file);
const data = new FormData();
data.append('file', file);
axios.post('接口地址', data,{
headers: {
'Content-Type': 'multipart/form-data',
},
}).then(res => {
console.log(res);
alert('上传成功')
}).catch(err => {
console.log(err);
alert('上传失败')
});
},

img

header里边的方法也是post

img


各位帮我看看,找两天了

  • 写回答

3条回答 默认 最新

报告相同问题?

问题事件

  • 修改了问题 3月21日
  • 创建了问题 3月21日