copy(server): 文件管理错误文案按 human-copy 重写
「根」统一叫登记目录;去掉「请…」;H&R 拦截不再露待处理事项 ID,改给下一步动作。 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei
This commit is contained in:
1 parent
50aa02cfc5
commit
12a8caa463
13 files changed
+57
-53
No files matched your search
@@ -41,7 +41,8 @@ export async function uploadFile(
|
||||
if (!body) throw new FilesError("bad_request", "请求体为空");
|
||||
const r = await resolveIn(d, q.root, q.path);
|
||||
if (!r.lst?.isDirectory() || r.isSymlink) throw new FilesError("bad_request", `不是目录:${r.rel || "/"}`);
|
||||
if (!(await isWritableTarget(r.def, r.rootReal))) throw new FilesError("not_writable", `根 ${r.def.name} 不可写`);
|
||||
if (!(await isWritableTarget(r.def, r.rootReal)))
|
||||
throw new FilesError("not_writable", `登记目录「${r.def.name}」不可写`);
|
||||
if (sanitizeSegment(q.name) !== q.name)
|
||||
throw new FilesError("bad_request", `文件名含非法字符或首尾有空白/点,可改为:${sanitizeSegment(q.name)}`);
|
||||
await recheck(r.abs, r.rootReal);
|
||||
|
||||
Reference in new issue
Block a user