From 2a7958b7c686ffe165471616f1d5ad102bc638b4 Mon Sep 17 00:00:00 2001 From: cool Date: Mon, 19 Feb 2024 17:06:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=87=E4=BB=B6=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E4=B8=BA=E6=8F=92=E4=BB=B6=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/base/controller/app/comm.ts | 10 ++++++---- src/modules/user/config.ts | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/modules/base/controller/app/comm.ts b/src/modules/base/controller/app/comm.ts index 40fb442..4c477a3 100644 --- a/src/modules/base/controller/app/comm.ts +++ b/src/modules/base/controller/app/comm.ts @@ -8,8 +8,8 @@ import { CoolTag, } from '@cool-midway/core'; import { Context } from '@midwayjs/koa'; -import { CoolFile } from '@cool-midway/file'; import { BaseSysParamService } from '../../service/sys/param'; +import { PluginService } from '../../../plugin/service/info'; /** * 不需要登录的后台接口 @@ -19,7 +19,7 @@ import { BaseSysParamService } from '../../service/sys/param'; @CoolController() export class BaseAppCommController extends BaseController { @Inject() - coolFile: CoolFile; + pluginService: PluginService; @Inject() ctx: Context; @@ -57,7 +57,8 @@ export class BaseAppCommController extends BaseController { */ @Post('/upload', { summary: '文件上传' }) async upload() { - return this.ok(await this.coolFile.upload(this.ctx)); + const file = await this.pluginService.getInstance('upload'); + return this.ok(await file.upload(this.ctx)); } /** @@ -65,6 +66,7 @@ export class BaseAppCommController extends BaseController { */ @Get('/uploadMode', { summary: '文件上传模式' }) async uploadMode() { - return this.ok(await this.coolFile.getMode()); + const file = await this.pluginService.getInstance('upload'); + return this.ok(await file.getMode()); } } diff --git a/src/modules/user/config.ts b/src/modules/user/config.ts index 4b250d2..6e0946b 100644 --- a/src/modules/user/config.ts +++ b/src/modules/user/config.ts @@ -41,7 +41,7 @@ export default () => { // 刷新token 过期时间,单位秒 refreshExpire: 60 * 60 * 24 * 30, // jwt 秘钥 - secret: '98591b81ce3111eebb6f5ba31567ea59', + secret: 'cool-app-xxxxxx', }, } as ModuleConfig; };