From a91133445944ac4ee998991811fe20ef66ca7e44 Mon Sep 17 00:00:00 2001 From: abearxiong Date: Wed, 21 Jan 2026 15:56:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E9=87=8D=E8=BF=9E?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BB=A5=E5=A2=9E=E5=8A=A0=E6=AF=8F=E6=AC=A1?= =?UTF-8?q?=E8=BF=9E=E6=8E=A5=E5=B0=9D=E8=AF=95=E7=9A=84=E5=BB=B6=E8=BF=9F?= =?UTF-8?q?=E6=97=B6=E9=97=B4=EF=BC=9B=E6=9B=B4=E6=96=B0=20mvFile=20?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E4=BB=A5=E6=94=AF=E6=8C=81=20'app-file'=20?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assistant/local-app-manager/assistant-app.ts | 2 +- assistant/src/module/upload/mv.ts | 12 +++++++----- assistant/src/routes/light-code/call.ts | 3 ++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/assistant/src/module/assistant/local-app-manager/assistant-app.ts b/assistant/src/module/assistant/local-app-manager/assistant-app.ts index 052d60d..30751fa 100644 --- a/assistant/src/module/assistant/local-app-manager/assistant-app.ts +++ b/assistant/src/module/assistant/local-app-manager/assistant-app.ts @@ -122,7 +122,7 @@ export class AssistantApp extends Manager { } else { setTimeout(() => { this.reconnectRemoteApp(); - }, 30 * 1000); // 30秒后重连 + }, 30 * 1000 + this.attemptedConnectTimes * 10 * 1000); // 30秒后重连 + 每次增加10秒 } } } diff --git a/assistant/src/module/upload/mv.ts b/assistant/src/module/upload/mv.ts index f4a3c5e..a1728e0 100644 --- a/assistant/src/module/upload/mv.ts +++ b/assistant/src/module/upload/mv.ts @@ -8,15 +8,17 @@ export class UploadManager { } mvFile(opts: { temppath: string; - type: 'file' | 's3'; + type: 'file' | 's3' | 'app-file'; targetPath: string; }) { - const { type, temppath, targetPath } = opts; - if (type === 'file') { - const pageDir = this.config.configPath?.pagesDir!; + const { type = 'file', temppath, targetPath } = opts; + const pageDir = this.config.configPath?.pagesDir!; + const appsDir = this.config.configPath?.appsDir!; + let dir = type === 'app-file' ? appsDir : pageDir; + if (type === 'file' || type === 'app-file') { const fullTargetPath = targetPath.startsWith('/') ? targetPath - : path.join(pageDir, targetPath); + : path.join(dir, targetPath); const targetDir = fullTargetPath.substring(0, fullTargetPath.lastIndexOf('/')); if (!fs.existsSync(targetDir)) { fs.mkdirSync(targetDir, { recursive: true }); diff --git a/assistant/src/routes/light-code/call.ts b/assistant/src/routes/light-code/call.ts index b6263ce..716071e 100644 --- a/assistant/src/routes/light-code/call.ts +++ b/assistant/src/routes/light-code/call.ts @@ -4,7 +4,8 @@ import { runCode } from '../../module/light-code/run.ts' // http://localhost:4005/api/router?path=call app.route({ - path: 'call', + path: 'light-code', + key: 'call', // middleware: ['auth'] }).define(async (ctx) => { const filename = ctx.query?.filename || 'root/light-code-demo/demo-router.ts'