From baf92f470ade749ed2a390655bbf429cb41f9999 Mon Sep 17 00:00:00 2001 From: Jerryplusy Date: Sun, 12 Oct 2025 01:16:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/openlist/openlist.service.ts | 11 ++++++++--- src/modules/meme/meme.controller.ts | 3 +-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/core/openlist/openlist.service.ts b/src/core/openlist/openlist.service.ts index 59c743b..02840ba 100644 --- a/src/core/openlist/openlist.service.ts +++ b/src/core/openlist/openlist.service.ts @@ -1,6 +1,6 @@ import { Inject, Injectable, Logger } from '@nestjs/common'; import { AppConfigService } from '../../config/config.service'; -import { FileInfo, FsList } from './openlist.types'; +import { FileInfo, FileUpload, FsList } from './openlist.types'; import { OpenListUtils } from './openlist.utils'; import * as moment from 'moment'; @@ -148,13 +148,18 @@ export class OpenListService { filePath: string, file: any, filePathOnserver: string, - ): Promise { + ): Promise { try { const token = await this.fetchToken( this.configService.get('OPENLIST_API_BASE_USERNAME'), this.configService.get('OPENLIST_API_BASE_PASSWORD'), ); - await OpenListUtils.uploadFile(token, filePath, filePathOnserver, file); + return await OpenListUtils.uploadFile( + token, + filePath, + filePathOnserver, + file, + ); } catch (error) { this.logger.error('上传文件失败:', error); throw new Error('上传文件失败'); diff --git a/src/modules/meme/meme.controller.ts b/src/modules/meme/meme.controller.ts index 9a3e463..37e631b 100644 --- a/src/modules/meme/meme.controller.ts +++ b/src/modules/meme/meme.controller.ts @@ -209,7 +209,6 @@ export class MemeController { @UploadedFile() file: Express.Multer.File, @Body('character') character: string, @Body('status') status: string, - @Res() res: Response, ) { if (!file) { throw new HttpException('未检测到上传文件', HttpStatus.BAD_REQUEST); @@ -270,7 +269,7 @@ export class MemeController { remoteFilePath, ); this.logger.log(`表情包上传成功: ${remoteFilePath}`); - return '表情上传成功!'; + return '表情上传成功..'; } catch (error) { this.logger.error('表情包上传失败:', error); throw new HttpException(