@cicctencent/midwayjs-base 1.0.39 → 1.0.40

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'],
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.40",
4
4
  "description": "基础框架,服务",
5
5
  "main": "dist/index.js",
6
6
  "typings": "index.d.ts",