Parcourir la source

feat(文件预览):图片预览名字更换

sufan il y a 6 mois
Parent
commit
b1af02e54f
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      src/components/Upload/index.vue

+ 2 - 1
src/components/Upload/index.vue

@@ -449,7 +449,8 @@ export default {
       // window.open(`#/perview?fileId=${idNum}&name=${name}&absolutePath=${absolutePath}`)
       const imgType = ['.jpg', '.png', '.jpeg', '.gif', '.bmp']
       if ((type && imgType.includes(type.toLowerCase())) || imgType.includes(fileType?.toLowerCase())) {
-        window.open(`#/perview?fileId=${idNum}&name=${name}&absolutePath=${absolutePath}`)
+        const newName = `预览图片${fileType || type}`
+        window.open(`#/perview?fileId=${idNum}&absolutePath=${absolutePath}&name=${newName}`)
       } else {
         window.open(`${process.env.VUE_APP_BASE_API}/system/fileStorage/preview?fileId=${idNum}&resource=${fileType ? 0 : 1}`)
       }