From d0901f517e28dea5a400365dfcaa248a869ddfe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=95=8A=E5=B9=B3?= <951984189@qq.com> Date: Tue, 23 Mar 2021 12:01:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=AE=BE=E7=BD=AE=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E5=88=9D=E5=A7=8B=E5=8C=96=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 6 +++--- src/config/config.default.ts | 5 ++++- src/config/config.prod.ts | 6 ++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a1fa187..ef9e18b 100755 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "lodash": "^4.17.21", "md5": "^2.3.0", "midwayjs-cool-alipay": "^1.0.3", - "midwayjs-cool-core": "^3.1.3", + "midwayjs-cool-core": "^3.1.4", "midwayjs-cool-oss": "^1.0.12", "midwayjs-cool-queue": "^1.0.6", "midwayjs-cool-redis": "^1.0.9", @@ -44,7 +44,7 @@ "node": ">=12.0.0" }, "scripts": { - "start": "egg-scripts start --daemon --title=cool-admin-midway --framework=@midwayjs/web --port=8001 --sticky", + "start": "egg-scripts start --title=cool-admin-midway --framework=@midwayjs/web --port=8001 --sticky", "stop": "egg-scripts stop --title=cool-admin-midway", "start_build": "npm run build && cross-env NODE_ENV=development midway-bin dev", "docker": "egg-scripts start --title=cool-admin-midway --framework=@midwayjs/web --sticky", @@ -81,4 +81,4 @@ }, "author": "cool-js.com", "license": "MIT" -} \ No newline at end of file +} diff --git a/src/config/config.default.ts b/src/config/config.default.ts index 47700fc..19e1cbf 100644 --- a/src/config/config.default.ts +++ b/src/config/config.default.ts @@ -1,4 +1,5 @@ import { EggAppConfig, EggAppInfo, PowerPartial } from 'egg'; +import { CoolConfig } from 'midwayjs-cool-core'; import * as path from 'path'; export type DefaultConfig = PowerPartial; @@ -48,6 +49,8 @@ export default (appInfo: EggAppInfo) => { // cool-admin特有的配置 config.cool = { + // 是否初始化模块数据库 + initDB: true, // 全局路由前缀 router: { prefix: '', @@ -76,7 +79,7 @@ export default (appInfo: EggAppInfo) => { // 文件路径前缀 本地上传模式下 有效 domain: 'https://admin.cool-js.cool', }, - }; + } as CoolConfig; // 文件上传 config.multipart = { diff --git a/src/config/config.prod.ts b/src/config/config.prod.ts index 6a3fb91..06c3905 100644 --- a/src/config/config.prod.ts +++ b/src/config/config.prod.ts @@ -24,5 +24,11 @@ export default (appInfo: EggAppInfo) => { }, }; + // cool配置 + config.cool = { + // 是否初始化模块数据库 + initDB: false, + }; + return config; };