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(