优化上传成功方法处理

This commit is contained in:
不做码农
2021-12-12 16:37:52 +08:00
parent 77aec2ed3d
commit 1e1e494d5b
2 changed files with 11 additions and 4 deletions

View File

@@ -144,10 +144,12 @@ export default {
},
// 上传成功回调
handleUploadSuccess(res, file) {
if (res.code != 200) {
this.msgError(`上传失败,原因:${res.msg}!`);
return;
}
this.msgSuccess("上传成功");
console.log(res.data.fileName, res.data.url);
this.fileList.push({ name: res.data.fileName, url: res.data.url });
this.$emit("input", this.column, this.listToString(this.fileList));
},
// 删除文件