From 4311527356a42c23d86a7b3b8544a9eb9e0f105e Mon Sep 17 00:00:00 2001 From: imeepos Date: Thu, 4 Sep 2025 21:12:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.controller.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app.controller.ts b/src/app.controller.ts index 965e111..7763001 100644 --- a/src/app.controller.ts +++ b/src/app.controller.ts @@ -9,7 +9,7 @@ export class AppController { constructor( @InjectRepository(TemplateExecutionEntity) private readonly executionRepository: Repository, - ) {} + ) { } @Post('callback') async callback(@Body() body: any): Promise> { console.log(`πŸš€ [ε›žθ°ƒ] εΌ€ε§‹ζ‰§θ‘Œε›žθ°ƒ`); @@ -19,8 +19,8 @@ export class AppController { const res = body.data; // {status: true, data: string[], task_id: string} let resultUrl = `` - if (res.status) { - const data = res.data; + if (body.status) { + const data = body.data; if (!data) throw new Error(`η»“ζžœζœ‰θ――`); if (Array.isArray(data) && data.length > 0) { resultUrl = data[0]; @@ -40,8 +40,8 @@ export class AppController { // ζ›΄ζ–°ζ‰§θ‘ŒηŠΆζ€ const updateData: Partial = { completedAt: new Date(), - executionDuration: execution.startedAt - ? Date.now() - execution.startedAt.getTime() + executionDuration: execution.startedAt + ? Date.now() - execution.startedAt.getTime() : undefined, }; @@ -59,7 +59,7 @@ export class AppController { } await this.executionRepository.update(execution.id, updateData); - + return ResponseUtil.success(resultUrl, 'ε›žθ°ƒε€„η†ζˆεŠŸ'); } }