소스 검색

覆盖 主干配置

lrf 2 년 전
부모
커밋
e453d8c4a1
2개의 변경된 파일86개의 추가작업 그리고 16개의 파일을 삭제
  1. 85 15
      config/config.prod.js
  2. 1 1
      config/config.prodDev.js

+ 85 - 15
config/config.prod.js

@@ -1,9 +1,39 @@
+/* eslint valid-jsdoc: "off" */
+
 'use strict';
-// 服务器-生产环境
-module.exports = (appInfo) => {
+// 开发配置文件
+/**
+ * @param {Egg.EggAppInfo} appInfo app info
+ */
+const { jwt } = require('./config.secret');
+module.exports = appInfo => {
+  /**
+   * built-in config
+   * @type {Egg.EggAppConfig}
+   **/
   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';
+  config.dbName = 'point_shopping-dev';
   config.mongoose = {
     url: `mongodb://127.0.0.1:27017/${config.dbName}`, // 120.48.146.1 127.0.0.1
     options: {
@@ -13,42 +43,82 @@ module.exports = (appInfo) => {
       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: 1,
+      db: 2,
     },
   };
   // mq设置
   config.amqp = {
     client: {
       hostname: '127.0.0.1',
-      username: 'tehq',
-      password: 'tehq',
-      vhost: 'tehq',
+      username: 'tehqDev',
+      password: 'tehqDev',
+      vhost: 'tehqDev',
     },
     app: true,
     agent: true,
   };
   // 定时任务机制设置
   config.taskMqConfig = {
-    ex: 'task',
-    queue: 'task',
-    routingKey: 'tr',
-    deadEx: 'deadTask',
-    deadQueue: 'deadTaskQueue',
-    deadLetterRoutingKey: 'deadTr',
+    ex: 'taskDev',
+    queue: 'taskDev',
+    routingKey: 'trDev',
+    deadEx: 'deadTaskDev',
+    deadQueue: 'deadTaskQueueDev',
+    deadLetterRoutingKey: 'deadTrDev',
   };
-  config.logger = {
-    level: 'NONE',
+
+  // 路由设置
+  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',
+  };
+  config.emailConfig = {
+    config: 'free',
+  };
+  config.smsConfig = {
+    config: 'free',
+  };
+  // 中间件
+  config.requestLog = {
+    toMongoDB: true,
   };
 
+  config.redisKey = {
+    orderKeyPrefix: 'orderKey:',
+  };
+  config.redisTimeout = 3600;
+  config.errcode = {
+    groupJoinRefund: -111,
+  };
+  config.wxPayConfig = 'pointApp';
   return {
     ...config,
+    ...userConfig,
   };
 };

+ 1 - 1
config/config.prodDev.js

@@ -1,7 +1,7 @@
 /* eslint valid-jsdoc: "off" */
 
 'use strict';
-// 开发配置文件-服务器
+// 开发配置文件
 /**
  * @param {Egg.EggAppInfo} appInfo app info
  */