This commit is contained in:
Baobhan Sith
2025-04-18 15:54:36 +08:00
parent 32e522f9a4
commit cf8543641e
2 changed files with 242 additions and 17 deletions
@@ -157,7 +157,10 @@ export function createSftpActionsManager(
}
if (!newName || item.filename === newName) return;
const oldPath = joinPath(currentPathRef.value, item.filename);
const newPath = joinPath(currentPathRef.value, newName);
// 检查 newName 是否已经是绝对路径 (来自拖拽移动)
const newPath = newName.startsWith('/')
? newName // 如果是绝对路径,直接使用
: joinPath(currentPathRef.value, newName); // 否则,视为相对路径并拼接
const requestId = generateRequestId();
sendMessage({ type: 'sftp:rename', requestId: requestId, payload: { oldPath, newPath } });
};
@@ -589,3 +592,4 @@ export function createSftpActionsManager(
cleanup,
};
}