fix:修复依赖错误

This commit is contained in:
Jerry 2025-10-12 01:16:02 +08:00
parent 7444c9090a
commit baf92f470a
2 changed files with 9 additions and 5 deletions

View File

@ -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<void> {
): Promise<FileUpload> {
try {
const token = await this.fetchToken(
<string>this.configService.get('OPENLIST_API_BASE_USERNAME'),
<string>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('上传文件失败');

View File

@ -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(