二開(kāi)時(shí)增加了批量上傳導(dǎo)入商品,上傳excel時(shí)獲取不到文件
$_FILES 同樣是空的
前端代碼
postfile() {
if (this.file === ''){
this.$notify.error({
title: "錯(cuò)誤",
message: "上傳文件不能為空"
})
return false
} else {
console.log(this.file)
let formData = new FormData()
formData.append('file',this.file)
this.btn.disable = true
this.btn.message = "正在導(dǎo)入,請(qǐng)等待"
importExcelApi(formData).then(res => {
console.log(res.message)
})
}
},
這里打印file是正確的值
我在接收文件代碼里直接
return app('json')->success($_FILES);
返回值是空的,用框架的 $this->request->file()同樣獲取不到
求助支個(gè)招