@cicctencent/midwayjs-base 1.0.39 → 1.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -41,6 +41,10 @@ exports.default = (appInfo) => {
41
41
  appInfo.dist = path.join(appRoot, 'dist');
42
42
  appInfo.webDist = path.join(appInfo.dist, 'web');
43
43
  appInfo.webPublic = path.join(appInfo.webDist, 'public');
44
+ const SESSION_SECRET = process.env.SESSION_SECRET;
45
+ if (!SESSION_SECRET && process.env.NODE_ENV !== 'unittest') {
46
+ console.log('[SECURITY WARNING] SESSION_SECRET环境变量未配置,请在.env文件中添加SESSION_SECRET配置。');
47
+ }
44
48
  if (!fs.existsSync(appInfo.webPublic)) {
45
49
  fs.mkdirSync(appInfo.webPublic, {
46
50
  recursive: true,
@@ -122,7 +126,7 @@ exports.default = (appInfo) => {
122
126
  },
123
127
  session: {
124
128
  timeout: Number(process.env.SESSION_TIMEOUT) || 20 * 60 * 1000,
125
- secretKey: 'fjjiowhb@#$^111)*&',
129
+ secretKey: SESSION_SECRET || 'fjjiowhb@#$^111)*&',
126
130
  },
127
131
  auth: {
128
132
  ignores: [/\/api\/test\//i, '/api/test/action'],
@@ -51,7 +51,6 @@ const apiResultFormatter_1 = require("./middleware/apiResultFormatter");
51
51
  const requestInit_1 = require("./middleware/requestInit");
52
52
  const detect_middleware_1 = require("./middleware/detect.middleware");
53
53
  const view = __importStar(require("@midwayjs/view-nunjucks"));
54
- const staticFile = __importStar(require("@midwayjs/static-file"));
55
54
  const cacheManager = __importStar(require("@midwayjs/cache-manager"));
56
55
  const DefaultConfig = __importStar(require("./config/config.default"));
57
56
  const api_1 = require("./guard/api");
@@ -89,7 +88,6 @@ exports.BaseConfiguration = BaseConfiguration = __decorate([
89
88
  enabledEnvironment: ['local'],
90
89
  },
91
90
  view,
92
- staticFile,
93
91
  axios,
94
92
  cacheManager,
95
93
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cicctencent/midwayjs-base",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
4
4
  "description": "基础框架,服务",
5
5
  "main": "dist/index.js",
6
6
  "typings": "index.d.ts",