@@ -114,8 +114,7 @@ export default function useFileUpload() {
114
114
visible . value = true ;
115
115
fileList . forEach ( ( item ) => {
116
116
beforeUpload ( {
117
- file : item ,
118
- uploadToPath : currentPath . value
117
+ file : item
119
118
} ) ;
120
119
} )
121
120
}
@@ -355,13 +354,16 @@ export default function useFileUpload() {
355
354
* @param param
356
355
*/
357
356
const beforeUpload = ( param ) => {
358
- uploadFile ( param . file , param . uploadToPath ) ;
357
+ uploadFile ( param . file , param . uploadBasePath ) ;
359
358
}
360
359
361
360
// 文件上传操作.
362
- const uploadFile = ( file , uploadToPath ) => {
361
+ const uploadFile = ( file , uploadBasePath ) => {
363
362
const fileIndex = uploadIndex ++ ;
364
- uploadToPath = uploadToPath || currentPath . value ;
363
+
364
+ uploadBasePath = uploadBasePath || currentPath . value ;
365
+
366
+ let uploadToPath = uploadBasePath ;
365
367
366
368
// 如果包含 webkitRelativePath, 则表示是文件夹上传, 需要获取文件完整路径
367
369
if ( file . webkitRelativePath || file . dropUploadPath ) {
@@ -397,7 +399,7 @@ export default function useFileUpload() {
397
399
waitingFileList . push ( {
398
400
index : fileIndex ,
399
401
file : file ,
400
- uploadToPath : uploadToPath ,
402
+ uploadBasePath : uploadBasePath ,
401
403
} ) ;
402
404
return ;
403
405
}
@@ -683,7 +685,7 @@ export default function useFileUpload() {
683
685
let fileItem = spliceList [ 0 ] ;
684
686
beforeUpload ( {
685
687
file : fileItem . file ,
686
- uploadToPath : fileItem . uploadToPath
688
+ uploadBasePath : fileItem . uploadBasePath
687
689
} ) ;
688
690
console . log ( '开始从等待队列中获取上传文件: ' , fileItem . file . name ) ;
689
691
}
0 commit comments