发表于: 2020-04-29 23:07:04
1 1911
今天完成的事情:
完善了图片上传的功能:
之前上传按钮一只报400,bad request,原因是因为数据错误,我传的参数是base64位的图片,但是需要传递的参数是从file中拿到的,再有就是需要通过更改headers的content-type来实现传递二进制参数:
update() {
let val = document.getElementById('file').files
this.$store.commit('updatePic' , val)
axios.post('api/a/u/img/3' , this.$store.state.MultipartFile , {
Headers: {
'Content-Type': 'multipart/form-data'
}
})
.then(res => {
console.log(res)
})
},
明天要做的事情:
开始做日历,之前查了资料可能要自己写一个日历。
评论