浏览代码

【修改】bug

howie 3 年之前
父节点
当前提交
a088fe1f55
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/components/Common/image-upload.vue

+ 4 - 2
src/components/Common/image-upload.vue

@@ -202,15 +202,17 @@ export default {
       })
       })
 
 
       const fileName = file.name.substring(0, file.name.lastIndexOf('.'))
       const fileName = file.name.substring(0, file.name.lastIndexOf('.'))
-      const suffix = file.name.match(/.[^.]+$/)[0]
+      let suffix = file.name.match(/.[^.]+$/)[0]
+      console.log(suffix,fileName);
       // 押金申请上传限制
       // 押金申请上传限制
       if (this.startRestricting) {
       if (this.startRestricting) {
         const filterKeywords = this.restrictFilename.filter(k => fileName.includes(k))
         const filterKeywords = this.restrictFilename.filter(k => fileName.includes(k))
         console.log(filterKeywords)
         console.log(filterKeywords)
         if (!filterKeywords.length || suffix.includes('zip', 'rar', 'gz', 'apk')) {
         if (!filterKeywords.length || suffix.includes('zip', 'rar', 'gz', 'apk')) {
           this.fileName = `其他文件${suffix}`
           this.fileName = `其他文件${suffix}`
+          suffix = ''
         }
         }
-        
+
       }
       }
 
 
       this.$emit('handleIsFileName', file.name)
       this.$emit('handleIsFileName', file.name)