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

pull/239/MERGE
疯狂的狮子Li 3 years ago committed by Gitee
commit 1f2f2cfe98
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

@ -151,13 +151,19 @@ export default {
}, },
// //
handleUploadSuccess(res) { handleUploadSuccess(res) {
this.uploadList.push({ name: res.data.url, url: res.data.url }); if (res.code === 200) {
if (this.uploadList.length === this.number) { this.uploadList.push({ name: res.data.url, url: res.data.url });
this.fileList = this.fileList.concat(this.uploadList); if (this.uploadList.length === this.number) {
this.uploadList = []; this.fileList = this.fileList.concat(this.uploadList);
this.number = 0; this.uploadList = [];
this.$emit("input", this.listToString(this.fileList)); this.number = 0;
this.$emit("input", this.listToString(this.fileList));
this.$modal.closeLoading();
}
} else {
this.$modal.msgError(res.msg);
this.$modal.closeLoading(); this.$modal.closeLoading();
this.number--;
} }
}, },
// //

@ -122,13 +122,19 @@ export default {
}, },
// //
handleUploadSuccess(res) { handleUploadSuccess(res) {
this.uploadList.push({ name: res.data.url, url: res.data.url }); if (res.code === 200) {
if (this.uploadList.length === this.number) { this.uploadList.push({ name: res.data.url, url: res.data.url });
this.fileList = this.fileList.concat(this.uploadList); if (this.uploadList.length === this.number) {
this.uploadList = []; this.fileList = this.fileList.concat(this.uploadList);
this.number = 0; this.uploadList = [];
this.$emit("input", this.listToString(this.fileList)); this.number = 0;
this.$emit("input", this.listToString(this.fileList));
this.$modal.closeLoading();
}
} else {
this.$modal.msgError(res.msg);
this.$modal.closeLoading(); this.$modal.closeLoading();
this.number--;
} }
}, },
// loading // loading

Loading…
Cancel
Save