mirror of
https://github.com/crystelf/crystelf-core.git
synced 2025-10-14 05:19:19 +00:00
fix:修复依赖错误
This commit is contained in:
parent
7444c9090a
commit
baf92f470a
@ -1,6 +1,6 @@
|
|||||||
import { Inject, Injectable, Logger } from '@nestjs/common';
|
import { Inject, Injectable, Logger } from '@nestjs/common';
|
||||||
import { AppConfigService } from '../../config/config.service';
|
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 { OpenListUtils } from './openlist.utils';
|
||||||
import * as moment from 'moment';
|
import * as moment from 'moment';
|
||||||
|
|
||||||
@ -148,13 +148,18 @@ export class OpenListService {
|
|||||||
filePath: string,
|
filePath: string,
|
||||||
file: any,
|
file: any,
|
||||||
filePathOnserver: string,
|
filePathOnserver: string,
|
||||||
): Promise<void> {
|
): Promise<FileUpload> {
|
||||||
try {
|
try {
|
||||||
const token = await this.fetchToken(
|
const token = await this.fetchToken(
|
||||||
<string>this.configService.get('OPENLIST_API_BASE_USERNAME'),
|
<string>this.configService.get('OPENLIST_API_BASE_USERNAME'),
|
||||||
<string>this.configService.get('OPENLIST_API_BASE_PASSWORD'),
|
<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) {
|
} catch (error) {
|
||||||
this.logger.error('上传文件失败:', error);
|
this.logger.error('上传文件失败:', error);
|
||||||
throw new Error('上传文件失败');
|
throw new Error('上传文件失败');
|
||||||
|
@ -209,7 +209,6 @@ export class MemeController {
|
|||||||
@UploadedFile() file: Express.Multer.File,
|
@UploadedFile() file: Express.Multer.File,
|
||||||
@Body('character') character: string,
|
@Body('character') character: string,
|
||||||
@Body('status') status: string,
|
@Body('status') status: string,
|
||||||
@Res() res: Response,
|
|
||||||
) {
|
) {
|
||||||
if (!file) {
|
if (!file) {
|
||||||
throw new HttpException('未检测到上传文件', HttpStatus.BAD_REQUEST);
|
throw new HttpException('未检测到上传文件', HttpStatus.BAD_REQUEST);
|
||||||
@ -270,7 +269,7 @@ export class MemeController {
|
|||||||
remoteFilePath,
|
remoteFilePath,
|
||||||
);
|
);
|
||||||
this.logger.log(`表情包上传成功: ${remoteFilePath}`);
|
this.logger.log(`表情包上传成功: ${remoteFilePath}`);
|
||||||
return '表情上传成功!';
|
return '表情上传成功..';
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.error('表情包上传失败:', error);
|
this.logger.error('表情包上传失败:', error);
|
||||||
throw new HttpException(
|
throw new HttpException(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user