Pre Merge pull request !239 from 疯狂的狮子Li/N/A

This commit is contained in:
疯狂的狮子Li 2022-08-23 13:22:07 +00:00 committed by Gitee
commit 1f2f2cfe98
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 24 additions and 12 deletions

View File

@ -151,6 +151,7 @@ export default {
}, },
// //
handleUploadSuccess(res) { handleUploadSuccess(res) {
if (res.code === 200) {
this.uploadList.push({ name: res.data.url, url: res.data.url }); this.uploadList.push({ name: res.data.url, url: res.data.url });
if (this.uploadList.length === this.number) { if (this.uploadList.length === this.number) {
this.fileList = this.fileList.concat(this.uploadList); this.fileList = this.fileList.concat(this.uploadList);
@ -159,6 +160,11 @@ export default {
this.$emit("input", this.listToString(this.fileList)); this.$emit("input", this.listToString(this.fileList));
this.$modal.closeLoading(); this.$modal.closeLoading();
} }
} else {
this.$modal.msgError(res.msg);
this.$modal.closeLoading();
this.number--;
}
}, },
// //
handleDelete(index) { handleDelete(index) {

View File

@ -122,6 +122,7 @@ export default {
}, },
// //
handleUploadSuccess(res) { handleUploadSuccess(res) {
if (res.code === 200) {
this.uploadList.push({ name: res.data.url, url: res.data.url }); this.uploadList.push({ name: res.data.url, url: res.data.url });
if (this.uploadList.length === this.number) { if (this.uploadList.length === this.number) {
this.fileList = this.fileList.concat(this.uploadList); this.fileList = this.fileList.concat(this.uploadList);
@ -130,6 +131,11 @@ export default {
this.$emit("input", this.listToString(this.fileList)); this.$emit("input", this.listToString(this.fileList));
this.$modal.closeLoading(); this.$modal.closeLoading();
} }
} else {
this.$modal.msgError(res.msg);
this.$modal.closeLoading();
this.number--;
}
}, },
// loading // loading
handleBeforeUpload(file) { handleBeforeUpload(file) {