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'