做后台管理系统需要上传文件和图片,但是发送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('上传失败')
});
},
header里边的方法也是post
各位帮我看看,找两天了