Browse Source

fix(useImport): 修复从URL提取文件名时的解码问题

移除对URL的decodeURIComponent调用,直接使用分割后的部分作为文件名
添加console.log用于调试文件名提取
lsc 1 day ago
parent
commit
440e995871
1 changed files with 4 additions and 1 deletions
  1. 4 1
      src/hooks/useImport.ts

+ 4 - 1
src/hooks/useImport.ts

@@ -924,7 +924,10 @@ export default () => {
         return
         return
       }
       }
       
       
-      const name = decodeURIComponent(url.split(bucketUrl)[1])
+      // const name = decodeURIComponent(url.split(bucketUrl)[1])
+      const name = url.split(bucketUrl)[1]
+      console.log('aws-name:', name)
+      
       if (!name) {
       if (!name) {
         reject(new Error('Could not extract file name from URL'))
         reject(new Error('Could not extract file name from URL'))
         return
         return