From 379434cc310a1e4a44a137763180adaf1fffb654 Mon Sep 17 00:00:00 2001 From: From-wh Date: Mon, 26 Jun 2023 14:52:09 +0800 Subject: [PATCH] =?UTF-8?q?improve:=20=E4=B8=8A=E4=BC=A0=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/admin/src/pages/app/upload/index.vue | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/template/admin/src/pages/app/upload/index.vue b/template/admin/src/pages/app/upload/index.vue index ba2301e80..e5811c962 100644 --- a/template/admin/src/pages/app/upload/index.vue +++ b/template/admin/src/pages/app/upload/index.vue @@ -62,6 +62,7 @@ export default { }, methods: { selectImgs() { + if (this.loading) return; this.$refs['upload'].$refs['upload-inner'].handleClick(); }, again() { @@ -70,14 +71,19 @@ export default { this.allSize = 0; }, async submitUpload() { - this.loading = true; - for (let i = 0; i < this.imgList.length; i++) { - const file = this.imgList[i].raw; - await this.uploadItem(file); - if (i == this.imgList.length - 1) { - this.uploading = false; - this.loading = false; + if (this.imgList.length) { + if (this.loading) return; + this.loading = true; + for (let i = 0; i < this.imgList.length; i++) { + const file = this.imgList[i].raw; + await this.uploadItem(file); + if (i == this.imgList.length - 1) { + this.uploading = false; + this.loading = false; + } } + } else { + this.$Message.warning('请先选择图片'); } }, handleRemove(file) {