|
@@ -1,11 +1,23 @@
|
|
|
'use strict';
|
|
|
-// 默认配置-服务器
|
|
|
+// 默认配置
|
|
|
|
|
|
/**
|
|
|
* @param {Egg.EggAppInfo} appInfo app info
|
|
|
*/
|
|
|
+const ip = '192.168.1.197';
|
|
|
+const branch = 'Two';
|
|
|
+const branchRouter = 'two';
|
|
|
+const port = 12311;
|
|
|
+const dbName = `shopping${branch}`;
|
|
|
+const redisPwd = '';
|
|
|
+const redisDB = 3;
|
|
|
+const mqUser = `shopping${branch}`;
|
|
|
+const routePrefix = `/dev/point/${branchRouter}/v1/api`;
|
|
|
+const payReturn = `/dev/point/${branchRouter}/v1/api/pay/order`;
|
|
|
+const email_smsConfig = `shopping${branch}`;
|
|
|
+const appSign = `shopping${branch}`;
|
|
|
const { jwt } = require('./config.secret');
|
|
|
-module.exports = appInfo => {
|
|
|
+module.exports = (appInfo) => {
|
|
|
/**
|
|
|
* built-in config
|
|
|
* @type {Egg.EggAppConfig}
|
|
@@ -14,9 +26,9 @@ module.exports = appInfo => {
|
|
|
|
|
|
// use for cookie sign key, should change to your own and keep security
|
|
|
config.keys = appInfo.name + '_1664237342649_2194';
|
|
|
- config.appName = '天恩活泉商城-服务';
|
|
|
+ config.appName = '商城-服务';
|
|
|
// add your middleware config here
|
|
|
- config.middleware = [ 'errorEmail', 'setUserFromToken', 'checkLogin', 'checkUserRK' ]; // , 'checkLogin'
|
|
|
+ config.middleware = ['errorEmail', 'setUserFromToken', 'checkLogin', 'checkUserRK']; // , 'checkLogin'
|
|
|
|
|
|
// add your user config here
|
|
|
const userConfig = {
|
|
@@ -28,13 +40,12 @@ module.exports = appInfo => {
|
|
|
// 进程设置
|
|
|
config.cluster = {
|
|
|
listen: {
|
|
|
- port: 12111,
|
|
|
+ port: port,
|
|
|
},
|
|
|
};
|
|
|
// 数据库设置
|
|
|
- config.dbName = 'point_shopping';
|
|
|
config.mongoose = {
|
|
|
- url: `mongodb://127.0.0.1:27017/${config.dbName}`, // 120.48.146.1 127.0.0.1
|
|
|
+ url: `mongodb://120.48.146.1:27017/${dbName}`, // 120.48.146.1 127.0.0.1
|
|
|
options: {
|
|
|
user: 'admin',
|
|
|
pass: 'admin',
|
|
@@ -56,53 +67,51 @@ module.exports = appInfo => {
|
|
|
config.redis = {
|
|
|
client: {
|
|
|
port: 6379, // Redis port
|
|
|
- host: '127.0.0.1', // Redis host
|
|
|
- password: '123456',
|
|
|
- db: 1,
|
|
|
+ host: ip, // Redis host
|
|
|
+ password: redisPwd,
|
|
|
+ db: redisDB,
|
|
|
},
|
|
|
};
|
|
|
// mq设置
|
|
|
config.amqp = {
|
|
|
client: {
|
|
|
- hostname: '127.0.0.1',
|
|
|
- username: 'tehq',
|
|
|
- password: 'tehq',
|
|
|
- vhost: 'tehq',
|
|
|
+ hostname: ip,
|
|
|
+ username: mqUser,
|
|
|
+ password: mqUser,
|
|
|
+ vhost: mqUser,
|
|
|
},
|
|
|
app: true,
|
|
|
agent: true,
|
|
|
};
|
|
|
// 定时任务机制设置
|
|
|
config.taskMqConfig = {
|
|
|
- ex: 'task',
|
|
|
- queue: 'task',
|
|
|
- routingKey: 'tr',
|
|
|
- deadEx: 'deadTask',
|
|
|
- deadQueue: 'deadTaskQueue',
|
|
|
- deadLetterRoutingKey: 'deadTr',
|
|
|
+ ex: `task${branch}`,
|
|
|
+ queue: `task${branch}`,
|
|
|
+ routingKey: `tr${branch}`,
|
|
|
+ deadEx: `deadTask${branch}`,
|
|
|
+ deadQueue: `deadTaskQueue${branch}`,
|
|
|
+ deadLetterRoutingKey: `deadTr${branch}`,
|
|
|
};
|
|
|
config.msgEx = 't_m';
|
|
|
|
|
|
// 路由设置
|
|
|
- config.routePrefix = '/point/v1/api';
|
|
|
+ config.routePrefix = routePrefix;
|
|
|
// 支付路由回调设置
|
|
|
config.payReturn = {
|
|
|
- order: '/point/v1/api/pay/order',
|
|
|
+ order: payReturn,
|
|
|
};
|
|
|
|
|
|
// 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',
|
|
|
};
|
|
|
config.emailConfig = {
|
|
|
- config: 'tehq',
|
|
|
+ config: email_smsConfig,
|
|
|
};
|
|
|
config.smsConfig = {
|
|
|
- config: 'tehq',
|
|
|
+ config: email_smsConfig,
|
|
|
};
|
|
|
// 中间件
|
|
|
config.requestLog = {
|
|
@@ -116,11 +125,11 @@ module.exports = appInfo => {
|
|
|
config.errcode = {
|
|
|
groupJoinRefund: -111,
|
|
|
};
|
|
|
- config.wxPayConfig = 'tehqApp';
|
|
|
+ config.wxPayConfig = appSign;
|
|
|
config.logger = {
|
|
|
level: 'NONE',
|
|
|
};
|
|
|
- config.projects = [ 'group-service', 'service-point_shop' ]; // 协作项目:团购服务,尊荣服务
|
|
|
+ config.projects = ['group-service', 'service-point_shop']; // 协作项目:团购服务,尊荣服务
|
|
|
return {
|
|
|
...config,
|
|
|
...userConfig,
|