q-koa 12.5.4 → 12.5.6

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/core/app.js +25 -22
  2. package/package.json +1 -1
package/core/app.js CHANGED
@@ -291,11 +291,12 @@ class APP {
291
291
  `first app is http://localhost:3001/${appName}/setting/findOne`
292
292
  )
293
293
  } else {
294
- this.app[appName].service.log.push({
295
- app: this.app[appName],
296
- url: `http://${this.config.ip}:${this.port}/setting/findOne`,
297
- message: `${this.config.ip}:${this.port}项目启动成功`,
298
- })
294
+ this.app[appName].service.log &&
295
+ this.app[appName].service.log.push({
296
+ app: this.app[appName],
297
+ url: `http://${this.config.ip}:${this.port}/setting/findOne`,
298
+ message: `${this.config.ip}:${this.port}项目启动成功`,
299
+ })
299
300
  }
300
301
 
301
302
  const version = require('q-koa/package.json').version
@@ -691,24 +692,26 @@ class APP {
691
692
  },
692
693
  this.app[appName]
693
694
  )
694
- const mockObj = _.pickBy(
695
- _attributes,
696
- (item) => item.mock && typeof item.mock === 'function'
697
- )
698
- this.app[appName] = _.defaultsDeep(
699
- {
700
- mock: {
701
- [folder]: () =>
702
- _.zipObject(
703
- Object.keys(mockObj),
704
- Object.keys(mockObj).map((key) =>
705
- _.result(mockObj, `${key}.mock`)
706
- )
707
- ),
695
+ if (is_dev) {
696
+ const mockObj = _.pickBy(
697
+ _attributes,
698
+ (item) => item.mock && typeof item.mock === 'function'
699
+ )
700
+ this.app[appName] = _.defaultsDeep(
701
+ {
702
+ mock: {
703
+ [folder]: () =>
704
+ _.zipObject(
705
+ Object.keys(mockObj),
706
+ Object.keys(mockObj).map((key) =>
707
+ _.result(mockObj, `${key}.mock`)
708
+ )
709
+ ),
710
+ },
708
711
  },
709
- },
710
- this.app[appName]
711
- )
712
+ this.app[appName]
713
+ )
714
+ }
712
715
  } else if (
713
716
  [
714
717
  'config',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "12.5.4",
3
+ "version": "12.5.6",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {