Browse Source

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

sufan 6 months ago
parent
commit
b1af02e54f
1 changed files with 2 additions and 1 deletions
  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}`)
       }