From 2e4997da9caeff201b92c12c118a1dce0f383f9c Mon Sep 17 00:00:00 2001 From: liuyi Date: Mon, 9 Jun 2025 14:59:22 +0800 Subject: [PATCH] add config module --- src/config/app.config.ts | 2 +- src/config/database.config.ts | 4 ++-- src/config/meili.config.ts | 2 +- typings/global.d.ts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/config/app.config.ts b/src/config/app.config.ts index 794ee37..0bc3df7 100644 --- a/src/config/app.config.ts +++ b/src/config/app.config.ts @@ -3,6 +3,6 @@ import { toNumber } from 'lodash'; import { createAppConfig } from '@/modules/core/config'; export const app = createAppConfig((configure) => ({ - port: configure.env.get('APP_PORT', (v) => toNumber(v), 3099), + port: configure.env.get('APP_PORT', (v) => toNumber(v), 3000), prefix: 'api', })); diff --git a/src/config/database.config.ts b/src/config/database.config.ts index 1d38af8..60bcf78 100644 --- a/src/config/database.config.ts +++ b/src/config/database.config.ts @@ -7,9 +7,9 @@ export const database = createDBConfig((configure) => ({ connections: [ { type: 'mysql', - host: configure.env.get('DB_HOST', '127.0.0.1'), + host: configure.env.get('DB_HOST', '192.168.50.26'), port: configure.env.get('DB_PORT', (v) => toNumber(v), 3306), - username: configure.env.get('DB_USERNAME', 'root'), + username: configure.env.get('DB_USERNAME', '3r'), password: configure.env.get('DB_PASSWORD', '12345678'), database: configure.env.get('DB_NAME', '3r'), }, diff --git a/src/config/meili.config.ts b/src/config/meili.config.ts index 689c166..e9421f2 100644 --- a/src/config/meili.config.ts +++ b/src/config/meili.config.ts @@ -1,6 +1,6 @@ import { createMeiliConfig } from '../modules/meilisearch/config'; -export const MEILI_CONFIG = createMeiliConfig((configure) => [ +export const meili = createMeiliConfig((configure) => [ { name: 'default', host: 'http://192.168.50.26:7700', diff --git a/typings/global.d.ts b/typings/global.d.ts index c40c909..714339f 100644 --- a/typings/global.d.ts +++ b/typings/global.d.ts @@ -12,7 +12,7 @@ declare type ClassToPlain = { [key in keyof T]: T[key] }; declare type ClassType = { new (...args: any[]): T }; declare type RePartial = { - [P in keyof T]: T[P] extends (infer U)[] | undefined + [P in keyof T]?: T[P] extends (infer U)[] | undefined ? RePartial[] : T[P] extends object | undefined ? T[P] extends ((...args: any[]) => any) | ClassType | undefined