From 05a679c2c88b0e977284eb3e638cf4c717bdfa68 Mon Sep 17 00:00:00 2001 From: Qiufeng Date: Fri, 4 Sep 2026 22:27:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A1=A5=E5=85=A8=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=AD=A5=E6=A0=A1=E9=AA=8C=E4=B8=8E=E5=87=86=E5=A4=87=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E5=8D=A1=E7=89=87=E6=B6=88=E9=99=A4=E7=A9=BA=E7=99=BD?= =?UTF-8?q?=E3=80=81=E4=BC=98=E5=8C=96=E5=A2=9E=E9=87=8F=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=B0=B1=E7=BB=AA=E5=86=85=E6=A0=B8=E5=8A=A0=E9=80=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- server/update-service.ts | 18 ++++++++++++++---- web-next/src/pages/update/UpdatePage.tsx | 16 ++++++++++++++++ 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 53412f1..fc9d9b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tallynote", - "version": "1.1.40", + "version": "1.1.41", "private": true, "type": "module", "packageManager": "pnpm@9.0.6", diff --git a/server/update-service.ts b/server/update-service.ts index 8fd14cb..adc235c 100644 --- a/server/update-service.ts +++ b/server/update-service.ts @@ -84,12 +84,22 @@ export function triggerInProcessDownload( try { const currentRelease = realpathSync(config.currentLink); if (currentRelease) { - const fsPromises = await import("node:fs/promises"); for (const entry of ["node_modules", "runtime", "pnpm-lock.yaml"] as const) { const source = path.join(currentRelease, entry); - const sourceInfo = await fsPromises.lstat(source).catch(() => null); - if (sourceInfo && !sourceInfo.isSymbolicLink()) { - await fsPromises.cp(source, path.join(stagedDir, entry), { recursive: sourceInfo.isDirectory(), errorOnExist: true, force: false }).catch(() => {}); + const target = path.join(stagedDir, entry); + let copied = false; + try { + const { execFile } = await import("node:child_process"); + const { promisify } = await import("node:util"); + await promisify(execFile)("cp", ["-a", source, target]); + copied = true; + } catch {} + if (!copied) { + const fsPromises = await import("node:fs/promises"); + const sourceInfo = await fsPromises.lstat(source).catch(() => null); + if (sourceInfo && !sourceInfo.isSymbolicLink()) { + await fsPromises.cp(source, target, { recursive: sourceInfo.isDirectory(), errorOnExist: true, force: false }).catch(() => {}); + } } } } diff --git a/web-next/src/pages/update/UpdatePage.tsx b/web-next/src/pages/update/UpdatePage.tsx index baa30ab..0c2a5dd 100644 --- a/web-next/src/pages/update/UpdatePage.tsx +++ b/web-next/src/pages/update/UpdatePage.tsx @@ -929,6 +929,22 @@ export default function UpdatePage({ )} + {/* 场景 B2: 校验与环境就绪中 (verifying) */} + {job?.status === "verifying" && ( +
+
+
+ 正在比对安全指纹并解压更新包... +
+
+ SHA-256 指纹核验通过,正在将生产环境就绪至版本暂存区... +
+

+ 系统正在核对发布包完整性与解压 dist 生产运行结构,校验就绪后将立即亮起“立即应用”按钮。 +

+
+ )} + {/* 场景 C: 校验通过准备就绪 (staged) (Exact ASCII) */} {job?.status === "staged" && (