소스 검색

更新配置

MaiXinRong 6 년 전
부모
커밋
a259703aa7
2개의 변경된 파일83개의 추가작업 그리고 2개의 파일을 삭제
  1. 81 0
      config/config.test.js
  2. 2 2
      package.json

+ 81 - 0
config/config.test.js

@@ -0,0 +1,81 @@
+'use strict';
+/**
+ * 开发环境相关配置
+ *
+ * @author CaiAoLin
+ * @date 2017/8/29
+ * @version
+ */
+
+module.exports = appInfo => {
+    const config = {};
+    // 数据库配置
+    config.mysql = {
+        client: {
+            // host
+            host: '127.0.0.1',
+            // 端口号
+            port: '3306',
+            // 用户名
+            user: 'root',
+            // 密码
+            password: 'root',
+            // 数据库名
+            database: 'calculation',
+        },
+        // 是否加载到 app 上,默认开启
+        app: true,
+        // 是否加载到 agent 上,默认关闭
+        agent: false,
+    };
+    // 表名前缀
+    config.tablePrefix = 'zh_';
+
+    // redis设置
+    config.redis = {
+        client: {
+            host: '127.0.0.1',
+            port: '6379',
+            password: 'test',
+            db: '0',
+        },
+        agent: true,
+        version: '1.0.0',
+    };
+
+    // session配置
+    config.session = {
+        key: 'ZHC_SESS',
+        maxAge: 5*1000, //8 * 3600 * 1000, // 8小时
+        httpOnly: true,
+        encrypt: true,
+    };
+
+    // geetest验证码key
+    config.geetest = {
+        id: '23c50f6711966f744c93a70167c8e0a4',
+        key: '9b67989994f9def437ea68bb495f0162',
+    };
+
+    // 前端验证
+    config.jsValidator = {
+        client: {},
+        app: true,
+    };
+
+    // 上传设置
+    config.multipart = {
+        whitelist: ['.xls', '.xlsx', '.json'],
+        fileSize: '10mb',
+    };
+
+    // 是否压缩替换前端js
+    config.min = false;
+
+    config.logger = {
+        consoleLevel: 'WARN',
+        disableConsoleAfterReady: false,
+    };
+
+    return config;
+};

+ 2 - 2
package.json

@@ -41,7 +41,7 @@
   },
   "scripts": {
     "start": "egg-scripts start --daemon --port 7002",
-    "start-local": "set EGG_SERVER_ENV=local&&egg-scripts start --deamon --port 7002",
+    "start-test": "set EGG_SERVER_ENV=test&&egg-scripts start --deamon --port 7002",
     "stop": "egg-scripts stop",
     "dev": "egg-bin dev --port 7002",
     "dev-local": "set EGG_SERVER_ENV=qa&&egg-bin dev --port 7002",
@@ -53,7 +53,7 @@
     "lint": "eslint .",
     "ci": "npm run lint && npm run cov",
     "autod": "autod",
-    "qa": "set EGG_SERVER_ENV=qa&npm run dev",
+    "qa": "set EGG_SERVER_ENV=local&&egg-scripts start --deamon --port 7002",
     "local": "set EGG_SERVER_ENV=local&npm run dev"
   },
   "ci": {