oak-backend-base 2.3.0 → 2.3.1

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.
Files changed (2) hide show
  1. package/lib/AppLoader.js +10 -8
  2. package/package.json +3 -3
package/lib/AppLoader.js CHANGED
@@ -120,14 +120,16 @@ class AppLoader extends types_1.AppLoader {
120
120
  // 对area暂时处理一下
121
121
  rows = require('./data/area.json');
122
122
  }
123
- await this.dbStore.operate(entity, {
124
- data: rows,
125
- action: 'create',
126
- }, context, {
127
- dontCollect: true,
128
- dontCreateOper: true,
129
- });
130
- console.log(`data in ${entity} initialized!`);
123
+ if (rows.length > 0) {
124
+ await this.dbStore.operate(entity, {
125
+ data: rows,
126
+ action: 'create',
127
+ }, context, {
128
+ dontCollect: true,
129
+ dontCreateOper: true,
130
+ });
131
+ console.log(`data in ${entity} initialized!`);
132
+ }
131
133
  }
132
134
  await context.commit();
133
135
  this.dbStore.disconnect();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oak-backend-base",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "oak-backend-base",
5
5
  "main": "lib/index",
6
6
  "author": {
@@ -21,8 +21,8 @@
21
21
  "mysql2": "^2.3.3",
22
22
  "node-schedule": "^2.1.0",
23
23
  "oak-common-aspect": "^2.1.3",
24
- "oak-db": "^2.2.0",
25
- "oak-domain": "^2.3.0",
24
+ "oak-db": "^2.2.1",
25
+ "oak-domain": "^2.3.2",
26
26
  "uuid": "^8.3.2"
27
27
  },
28
28
  "license": "ISC",