二手车交易,上传照片抛出异常

This commit is contained in:
2025-03-14 14:35:23 +08:00
parent dde6c337e2
commit 48fe4d404f

View File

@ -84,13 +84,12 @@ export default {
},
async handleFileRead(file) {
const formData = new FormData();
console.log("file.file",file.file)
if(!file.file){
this.$toast('获取文件失败,请重新上传')
}
formData.append("file", file.file);
let res = await uploadImage(formData);
/* try {
console.log("res", res)
} catch (e) {
console.log("e", e)
}*/
// 为文件添加唯一标识符
file.uid = Date.now(); // 使用时间戳作为唯一标识符
if (this.text == '行驶证照片') {