|
@@ -1,126 +1,54 @@
|
|
|
-/* eslint valid-jsdoc: "off" */
|
|
|
-
|
|
|
-'use strict';
|
|
|
-// 开发配置文件
|
|
|
-/**
|
|
|
- * @param {Egg.EggAppInfo} appInfo app info
|
|
|
- */
|
|
|
-const { jwt } = require('./config.secret');
|
|
|
-module.exports = appInfo => {
|
|
|
- /**
|
|
|
- * built-in config
|
|
|
- * @type {Egg.EggAppConfig}
|
|
|
- **/
|
|
|
+"use strict";
|
|
|
+// 开发服务-生产环境
|
|
|
+module.exports = (appInfo) => {
|
|
|
const config = (exports = {});
|
|
|
-
|
|
|
- // use for cookie sign key, should change to your own and keep security
|
|
|
- config.keys = appInfo.name + '_1664237342649_2194';
|
|
|
- config.appName = '天恩活泉商城-服务';
|
|
|
- // add your middleware config here
|
|
|
- config.middleware = [ 'errorEmail', 'setUserFromToken', 'checkLogin', 'checkUserRK' ]; // , 'checkLogin'
|
|
|
-
|
|
|
- // add your user config here
|
|
|
- const userConfig = {
|
|
|
- // myAppName: 'egg',
|
|
|
- };
|
|
|
- config.checkToken = {
|
|
|
- enable: false,
|
|
|
- };
|
|
|
- // 进程设置
|
|
|
- config.cluster = {
|
|
|
- listen: {
|
|
|
- port: 12211,
|
|
|
- },
|
|
|
- };
|
|
|
// 数据库设置
|
|
|
- config.dbName = 'point_shopping-dev';
|
|
|
+ config.dbName = "point_shopping";
|
|
|
config.mongoose = {
|
|
|
url: `mongodb://127.0.0.1:27017/${config.dbName}`, // 120.48.146.1 127.0.0.1
|
|
|
options: {
|
|
|
- user: 'admin',
|
|
|
- pass: 'admin',
|
|
|
- authSource: 'admin',
|
|
|
+ user: "admin",
|
|
|
+ pass: "admin",
|
|
|
+ authSource: "admin",
|
|
|
useNewUrlParser: true,
|
|
|
useCreateIndex: true,
|
|
|
useFindAndModify: true,
|
|
|
- allowDiskUse: true,
|
|
|
},
|
|
|
};
|
|
|
- // jwt设置
|
|
|
- config.jwt = {
|
|
|
- ...jwt,
|
|
|
- expiresIn: '1d',
|
|
|
- issuer: 'shopping',
|
|
|
- };
|
|
|
-
|
|
|
// redis设置
|
|
|
config.redis = {
|
|
|
client: {
|
|
|
port: 6379, // Redis port
|
|
|
- host: '127.0.0.1', // Redis host
|
|
|
- password: '123456',
|
|
|
- db: 2,
|
|
|
+ host: "127.0.0.1", // Redis host
|
|
|
+ password: "123456",
|
|
|
+ db: 1,
|
|
|
},
|
|
|
};
|
|
|
// mq设置
|
|
|
config.amqp = {
|
|
|
client: {
|
|
|
- hostname: '127.0.0.1',
|
|
|
- username: 'tehqDev',
|
|
|
- password: 'tehqDev',
|
|
|
- vhost: 'tehqDev',
|
|
|
+ hostname: "127.0.0.1",
|
|
|
+ username: "tehq",
|
|
|
+ password: "tehq",
|
|
|
+ vhost: "tehq",
|
|
|
},
|
|
|
app: true,
|
|
|
agent: true,
|
|
|
};
|
|
|
// 定时任务机制设置
|
|
|
config.taskMqConfig = {
|
|
|
- ex: 'taskDev',
|
|
|
- queue: 'taskDev',
|
|
|
- routingKey: 'trDev',
|
|
|
- deadEx: 'deadTaskDev',
|
|
|
- deadQueue: 'deadTaskQueueDev',
|
|
|
- deadLetterRoutingKey: 'deadTrDev',
|
|
|
+ ex: "task",
|
|
|
+ queue: "task",
|
|
|
+ routingKey: "tr",
|
|
|
+ deadEx: "deadTask",
|
|
|
+ deadQueue: "deadTaskQueue",
|
|
|
+ deadLetterRoutingKey: "deadTr",
|
|
|
};
|
|
|
- config.msgEx = 't_m_dev';
|
|
|
-
|
|
|
- // 路由设置
|
|
|
- config.routePrefix = '/dev/point/v1/api';
|
|
|
- // 支付路由回调设置
|
|
|
- config.payReturn = {
|
|
|
- order: '/dev/point/v1/api/pay/order',
|
|
|
- };
|
|
|
-
|
|
|
- // http请求前缀
|
|
|
- config.httpPrefix = {
|
|
|
- // wechat: 'http://127.0.0.1:14001/wechat/api',
|
|
|
- wechat: 'https://broadcast.waityou24.cn/wechat/api',
|
|
|
- // email: 'http://broadcast.waityou24.cn/semail/api',
|
|
|
- email: 'http://127.0.0.1:14002/semail/api',
|
|
|
- sms: 'http://127.0.0.1:14003/sms/api',
|
|
|
- chat: 'http://127.0.0.1:12214/dev/point/chat/v1/api',
|
|
|
- };
|
|
|
- config.emailConfig = {
|
|
|
- config: 'free',
|
|
|
- };
|
|
|
- config.smsConfig = {
|
|
|
- config: 'free',
|
|
|
- };
|
|
|
- // 中间件
|
|
|
- config.requestLog = {
|
|
|
- toMongoDB: true,
|
|
|
+ config.logger = {
|
|
|
+ level: "NONE",
|
|
|
};
|
|
|
|
|
|
- config.redisKey = {
|
|
|
- orderKeyPrefix: 'orderKey:',
|
|
|
- };
|
|
|
- config.redisTimeout = 3600;
|
|
|
- config.errcode = {
|
|
|
- groupJoinRefund: -111,
|
|
|
- };
|
|
|
- config.wxPayConfig = 'pointApp';
|
|
|
return {
|
|
|
...config,
|
|
|
- ...userConfig,
|
|
|
};
|
|
|
};
|