// 根據背景需求資料格式
const form = new FormData()
// 檔案對象
form.append('upload_file', file) //檔案流參數
form.append('path', 'news') // 添加form表單中其他資料
console.log(form)
axios
.post(url, form, {
headers: {
'Content-Type': 'multipart/form-data'
}
})
.then(res => {
resolve(res.data)
})
.catch(err => {
reject(err.data)
})