feat(remote): 实现文件上传真实进度显示
- 使用分块上传替代一次性上传 - 调用 /upload/start → /upload/chunk → /upload/merge 接口 - 通过 IPC 事件实时推送上传进度到前端 - 修复 merge 时未使用目标路径的问题
This commit is contained in:
@@ -91,9 +91,13 @@ class FileService {
|
||||
}
|
||||
}
|
||||
|
||||
mergeChunks(fileId, totalChunks, filename) {
|
||||
mergeChunks(fileId, totalChunks, filename, targetPath) {
|
||||
try {
|
||||
const filePath = path.normalize(filename);
|
||||
let targetDir = targetPath || 'C:\\';
|
||||
if (!fs.existsSync(targetDir)) {
|
||||
fs.mkdirSync(targetDir, { recursive: true });
|
||||
}
|
||||
const filePath = path.join(targetDir, filename);
|
||||
const dir = path.dirname(filePath);
|
||||
|
||||
if (!fs.existsSync(dir)) {
|
||||
|
||||
Reference in New Issue
Block a user