diff --git a/apps/api/.env b/apps/api/.env index d62b577..bbffc0a 100644 --- a/apps/api/.env +++ b/apps/api/.env @@ -1,9 +1,8 @@ # app APP_NAME = Nest Admin APP_PORT = 5001 +APP_BASE_URL = http://localhost:5001 APP_LOCALE = zh-CN -WS_PORT = 5002 -WS_PATH = ws-api # logger LOGGER_LEVEL = verbose diff --git a/apps/api/src/config/app.config.ts b/apps/api/src/config/app.config.ts index 9729fe8..c9f3158 100644 --- a/apps/api/src/config/app.config.ts +++ b/apps/api/src/config/app.config.ts @@ -5,7 +5,8 @@ import { env, envNumber } from '~/global/env' export const AppConfig = registerAs('app', () => ({ name: env('APP_NAME'), port: envNumber('APP_PORT', 3000), - globalPrefix: env('GLOBAL_PREFIX'), + baseUrl: env('APP_BASE_URL'), + globalPrefix: env('GLOBAL_PREFIX', 'api'), locale: env('APP_LOCALE', 'zh-CN'), logger: { diff --git a/apps/api/src/config/index.ts b/apps/api/src/config/index.ts index 38e630f..337034a 100644 --- a/apps/api/src/config/index.ts +++ b/apps/api/src/config/index.ts @@ -4,4 +4,3 @@ export * from './database.config' export * from './swagger.config' export * from './security.config' export * from './mailer.config' -export * from './sms.config' diff --git a/apps/api/src/config/sms.config.ts b/apps/api/src/config/sms.config.ts deleted file mode 100644 index f08eb7d..0000000 --- a/apps/api/src/config/sms.config.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { ConfigType, registerAs } from '@nestjs/config' - -import { env } from '~/global/env' - -export const SmsConfig = registerAs('sms', () => ({ - sign: env('SMS_SING', 'Youni'), - region: env('SMS_REGION', 'ap-guangzhou'), - appid: env('SMS_APPID', '1400437232'), - secretId: env('SMS_SECRET_ID', 'your-secret-id'), - secretKey: env('SMS_SECRET_KEY', 'your-secret-key'), -})) - -export type ISmsConfig = ConfigType diff --git a/apps/api/src/shared/helper/cron.service.ts b/apps/api/src/shared/helper/cron.service.ts index d9f9ad1..223cef5 100644 --- a/apps/api/src/shared/helper/cron.service.ts +++ b/apps/api/src/shared/helper/cron.service.ts @@ -10,12 +10,10 @@ import { AccessTokenEntity } from '~/modules/auth/entities/access-token.entity' @Injectable() export class CronService { - private logger: Logger + private logger: Logger = new Logger(CronService.name) constructor( private readonly configService: ConfigService, - ) { - this.logger = new Logger(CronService.name) - } + ) {} @CronOnce(CronExpression.EVERY_DAY_AT_MIDNIGHT) async deleteExpiredJWT() {