Prechádzať zdrojové kódy

复制粘贴限定图片设定

PrinceLee 5 rokov pred
rodič
commit
e6a5e50db0

+ 4 - 1
src/views/projectManage/bugList/details/index.vue

@@ -1205,9 +1205,12 @@ export default {
         const reader = new FileReader()
         reader.readAsDataURL(window.uploadFiles[0])
         reader.onload = () => {
+          const reg = new RegExp(/image\/png/)
           this.imageUrl = reader.result
+          if (this.imageUrl.match(reg)) { // 判断是否是图片
+            this.showCopyFile = true
+          }
         }
-        this.showCopyFile = true
       }
     },
     async confirmUpload() {

+ 4 - 0
src/views/projectManage/bugList/file/createdBug.vue

@@ -470,7 +470,11 @@ export default {
         const reader = new FileReader()
         reader.readAsDataURL(window.uploadFiles[0])
         reader.onload = () => {
+          const reg = new RegExp(/image\/png/)
           this.imageUrl = reader.result
+          if (this.imageUrl.match(reg)) { // 判断是否是图片
+            this.showCopyFile = true
+          }
         }
         this.showCopyFile = true
       }