|
@@ -17,7 +17,7 @@ export default (appInfo: EggAppInfo) => {
|
|
|
config.keys = appInfo.name + process.env.SECURITY_KEY || '_1687254724720_1708';
|
|
|
|
|
|
// add your egg config in here
|
|
|
- config.middleware = [];
|
|
|
+ config.middleware = [ 'auth' ];
|
|
|
|
|
|
// add your special config in here
|
|
|
const bizConfig = {
|
|
@@ -34,13 +34,11 @@ export default (appInfo: EggAppInfo) => {
|
|
|
};
|
|
|
config.sequelize = {
|
|
|
dialect: 'mysql',
|
|
|
- host: process.env.DATABASE_HOST || '127.0.0.1',
|
|
|
- port: process.env.DATABASE_PORT || 3306,
|
|
|
- database: process.env.DATABASE_DATABASE || 'egg',
|
|
|
- username: process.env.DATABASE_USERNAME || 'egg',
|
|
|
- password: process.env.DATABASE_PWD || '1995',
|
|
|
- underscored: true,
|
|
|
- timezone: process.env.TZ || '+UTC',
|
|
|
+ host: process.env.DATABASE_HOST || '192.168.2.254',
|
|
|
+ port: process.env.DATABASE_PORT ? Number(process.env.DATABASE_PORT) : 3306,
|
|
|
+ database: process.env.DATABASE_DATABASE || 'ai_metaspace',
|
|
|
+ username: process.env.DATABASE_USERNAME || 'root',
|
|
|
+ password: process.env.DATABASE_PWD || 'hope',
|
|
|
pool: {
|
|
|
max: 5,
|
|
|
min: 0,
|
|
@@ -48,27 +46,9 @@ export default (appInfo: EggAppInfo) => {
|
|
|
idle: 10000,
|
|
|
},
|
|
|
};
|
|
|
- // the return config will combines to EggAppConfig
|
|
|
+ // the return config will combine to EggAppConfig
|
|
|
return {
|
|
|
...config,
|
|
|
...bizConfig,
|
|
|
};
|
|
|
};
|
|
|
-
|
|
|
-// 数据库链接
|
|
|
-exports.sequelize = {
|
|
|
- dialect: 'mysql',
|
|
|
- host: process.env.DATABASE_HOST || '127.0.0.1',
|
|
|
- port: process.env.DATABASE_PORT || 3306,
|
|
|
- database: process.env.DATABASE_DATABASE || 'egg',
|
|
|
- username: process.env.DATABASE_USERNAME || 'egg',
|
|
|
- password: process.env.DATABASE_PWD || '1995',
|
|
|
- underscored: true,
|
|
|
- timezone: process.env.TZ || '+UTC',
|
|
|
- pool: {
|
|
|
- max: 5,
|
|
|
- min: 0,
|
|
|
- acquire: 30000,
|
|
|
- idle: 10000,
|
|
|
- },
|
|
|
-};
|