q-koa 7.7.3 → 7.7.5

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 (59) hide show
  1. package/core/file/plugins/administrator/controller.js +1 -1
  2. package/core/file/plugins/administrator/model.js +7 -9
  3. package/core/file/plugins/administrator/validate.js +1 -1
  4. package/core/file/plugins/alipay/controller.js +1 -1
  5. package/core/file/plugins/cloudfunction/model.js +3 -3
  6. package/core/file/plugins/common/controller.js +1 -1
  7. package/core/file/plugins/common/validate.js +14 -13
  8. package/core/file/plugins/douyin/controller.js +1 -7
  9. package/core/file/plugins/douyin/validate.js +17 -19
  10. package/core/file/plugins/douyin_user/model.js +1 -1
  11. package/core/file/plugins/good_sku/controller.js +1 -1
  12. package/core/file/plugins/h5_user/model.js +1 -1
  13. package/core/file/plugins/lang/model.js +3 -3
  14. package/core/file/plugins/language/model.js +5 -6
  15. package/core/file/plugins/log/controller.js +1 -1
  16. package/core/file/plugins/log/model.js +1 -1
  17. package/core/file/plugins/model/controller.js +1 -1
  18. package/core/file/plugins/model/model.js +1 -1
  19. package/core/file/plugins/model/validate.js +10 -13
  20. package/core/file/plugins/model_attributes/model.js +1 -1
  21. package/core/file/plugins/mp_user/model.js +1 -1
  22. package/core/file/plugins/permission/model.js +1 -1
  23. package/core/file/plugins/role/controller.js +1 -1
  24. package/core/file/plugins/role/model.js +1 -1
  25. package/core/file/plugins/role_permission/controller.js +1 -1
  26. package/core/file/plugins/role_permission/model.js +7 -8
  27. package/core/file/plugins/routes/controller.js +1 -1
  28. package/core/file/plugins/routes/model.js +1 -1
  29. package/core/file/plugins/setting/afterExecute.js +1 -1
  30. package/core/file/plugins/setting/controller.js +1 -1
  31. package/core/file/plugins/setting/model.js +1 -1
  32. package/core/file/plugins/setting/validate.js +13 -19
  33. package/core/file/plugins/system/controller.js +1 -6
  34. package/core/file/plugins/system/service.js +1 -1
  35. package/core/file/plugins/system/validate.js +20 -14
  36. package/core/file/plugins/todolist/model.js +1 -1
  37. package/core/file/plugins/toutiao/controller.js +1 -6
  38. package/core/file/plugins/toutiao_user/model.js +1 -1
  39. package/core/file/plugins/user/afterExecute.js +38 -33
  40. package/core/file/plugins/user/controller.js +1 -1
  41. package/core/file/plugins/user/model.js +29 -18
  42. package/core/file/plugins/user/test.js +53 -38
  43. package/core/file/plugins/user/validate.js +7 -8
  44. package/core/file/plugins/video/controller.js +4 -6
  45. package/core/file/plugins/video/validate.js +4 -4
  46. package/core/file/plugins/weixin/controller.js +1 -1
  47. package/core/file/plugins/weixin/service.js +1 -1
  48. package/core/file/plugins/weixin/validate.js +26 -27
  49. package/core/file/services/aliSms.js +29 -28
  50. package/core/file/services/alipay.js +1 -1
  51. package/core/file/services/amap.js +6 -6
  52. package/core/file/services/douyin.js +1 -1
  53. package/core/file/services/express.js +4 -4
  54. package/core/file/services/geo.js +1 -1
  55. package/core/file/services/toutiao.js +1 -1
  56. package/core/file/services/weixin.js +21 -12
  57. package/core/file/services/weixinMP.js +1 -1
  58. package/core/file/utils/index.js +1 -1
  59. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- const { getAppByCtx } = require('multiple-quick-koa')
1
+ const { getAppByCtx } = require('q-koa')
2
2
  const md5 = require('js-md5')
3
3
 
4
4
  const superAdmin = {
@@ -1,5 +1,5 @@
1
- const { Sequelize, Random } = require('multiple-quick-koa');
2
- const md5 = require('js-md5');
1
+ const { Sequelize, Random } = require('q-koa')
2
+ const md5 = require('js-md5')
3
3
 
4
4
  exports.name = {
5
5
  type: Sequelize.STRING,
@@ -9,7 +9,7 @@ exports.name = {
9
9
  defaultValue: '',
10
10
  sortOrder: 1,
11
11
  mock: () => Random.cword(5),
12
- };
12
+ }
13
13
 
14
14
  exports.password = {
15
15
  type: Sequelize.STRING,
@@ -21,7 +21,7 @@ exports.password = {
21
21
  set: function (value) {
22
22
  this.setDataValue('password', md5(value))
23
23
  },
24
- };
24
+ }
25
25
 
26
26
  exports.role_id = {
27
27
  type: Sequelize.MEDIUMINT.UNSIGNED,
@@ -30,8 +30,7 @@ exports.role_id = {
30
30
  is_mock: false,
31
31
  defaultValue: 0,
32
32
  sortOrder: 3,
33
-
34
- };
33
+ }
35
34
 
36
35
  exports.query = {
37
36
  type: Sequelize.JSON,
@@ -40,8 +39,7 @@ exports.query = {
40
39
  is_mock: false,
41
40
  defaultValue: {},
42
41
  sortOrder: 4,
43
- };
44
-
42
+ }
45
43
 
46
44
  exports.post = {
47
45
  type: Sequelize.JSON,
@@ -50,4 +48,4 @@ exports.post = {
50
48
  is_mock: false,
51
49
  defaultValue: {},
52
50
  sortOrder: 5,
53
- };
51
+ }
@@ -1,4 +1,4 @@
1
- const { Validator, getAppByCtx } = require('multiple-quick-koa')
1
+ const { Validator, getAppByCtx } = require('q-koa')
2
2
 
3
3
  exports.login = async (ctx) => {
4
4
  const params = {
@@ -1,6 +1,6 @@
1
1
  const Alipay = require('../../services/alipay')
2
2
 
3
- const { getAppByCtx, getConfig } = require('multiple-quick-koa')
3
+ const { getAppByCtx, getConfig } = require('q-koa')
4
4
  exports.h5_pay = async (ctx) => {
5
5
  const { app, appName } = getAppByCtx(ctx)
6
6
 
@@ -1,15 +1,15 @@
1
- const { Sequelize } = require('multiple-quick-koa');
1
+ const { Sequelize } = require('q-koa')
2
2
 
3
3
  exports.name = {
4
4
  type: Sequelize.STRING,
5
5
  comment: '函数名',
6
6
  allowNull: false,
7
7
  defaultValue: '',
8
- };
8
+ }
9
9
 
10
10
  exports.code_content = {
11
11
  type: Sequelize.TEXT,
12
12
  comment: '执行程序',
13
13
  allowNull: false,
14
14
  defaultValue: '',
15
- };
15
+ }
@@ -1,7 +1,7 @@
1
1
  const fs = require('fs')
2
2
  const path = require('path')
3
3
  const crypto = require('crypto')
4
- const { Random, lodash, getAppByCtx, getConfig } = require('multiple-quick-koa')
4
+ const { Random, lodash, getAppByCtx, getConfig } = require('q-koa')
5
5
  const Captchapng = require('captchapng')
6
6
  const qr = require('qr-image')
7
7
  const OSS = require('ali-oss')
@@ -1,4 +1,4 @@
1
- const { Validator } = require('multiple-quick-koa');
1
+ const { Validator } = require('q-koa')
2
2
 
3
3
  exports.email = async (ctx) => {
4
4
  const params = {
@@ -12,24 +12,25 @@ exports.email = async (ctx) => {
12
12
  required: true,
13
13
  message: '请输入邮件主题',
14
14
  },
15
- };
16
- await new Validator(params).validate(ctx.request.body);
17
- };
15
+ }
16
+ await new Validator(params).validate(ctx.request.body)
17
+ }
18
18
 
19
- exports.sendMessage = async ctx => {
19
+ exports.sendMessage = async (ctx) => {
20
20
  const params = {
21
21
  mobile: {
22
22
  type: 'string',
23
23
  required: true,
24
24
  validator: (rule, value) => {
25
- return /^[1][1,2,3,4,5,7,8,9][0-9]{9}$/.test(value) ? Promise.resolve() : Promise.reject('请输入正确手机号');
26
- }
25
+ return /^[1][1,2,3,4,5,7,8,9][0-9]{9}$/.test(value)
26
+ ? Promise.resolve()
27
+ : Promise.reject('请输入正确手机号')
28
+ },
27
29
  },
28
- };
29
- await new Validator(params).validate(ctx.request.body);
30
+ }
31
+ await new Validator(params).validate(ctx.request.body)
30
32
  }
31
33
 
32
-
33
34
  exports.schedule = async (ctx) => {
34
35
  const params = {
35
36
  to: {
@@ -42,6 +43,6 @@ exports.schedule = async (ctx) => {
42
43
  required: true,
43
44
  message: '请输入邮件主题',
44
45
  },
45
- };
46
- await new Validator(params).validate(ctx.request.body);
47
- };
46
+ }
47
+ await new Validator(params).validate(ctx.request.body)
48
+ }
@@ -1,10 +1,4 @@
1
- const {
2
- getAppByCtx,
3
- getConfig,
4
- lodash,
5
- moment,
6
- getService,
7
- } = require('multiple-quick-koa')
1
+ const { getAppByCtx, getConfig, lodash, moment, getService } = require('q-koa')
8
2
  const util = require('util')
9
3
  const axios = require('axios')
10
4
  const qr = require('qr-image')
@@ -1,40 +1,38 @@
1
- const { Validator } = require('multiple-quick-koa')
1
+ const { Validator } = require('q-koa')
2
2
  /**
3
- *
4
- * 详情 https://www.jianshu.com/p/2105c48b45c7
5
- *
6
- */
7
- exports.hotVideo = async ctx => {
3
+ *
4
+ * 详情 https://www.jianshu.com/p/2105c48b45c7
5
+ *
6
+ */
7
+ exports.hotVideo = async (ctx) => {
8
8
  const params = {
9
9
  word: {
10
10
  type: 'string',
11
11
  required: true,
12
12
  message: '请输入热词',
13
13
  },
14
- };
15
- await new Validator(params).validate(ctx.request.body);
16
- };
14
+ }
15
+ await new Validator(params).validate(ctx.request.body)
16
+ }
17
17
 
18
-
19
- exports.videoList = async ctx => {
18
+ exports.videoList = async (ctx) => {
20
19
  const params = {
21
20
  id: {
22
21
  type: 'number',
23
22
  required: true,
24
23
  message: '请输入id',
25
24
  },
26
- };
27
- await new Validator(params).validate(ctx.request.body);
28
- };
25
+ }
26
+ await new Validator(params).validate(ctx.request.body)
27
+ }
29
28
 
30
- exports.fansData = async ctx => {
29
+ exports.fansData = async (ctx) => {
31
30
  const params = {
32
31
  id: {
33
32
  type: 'number',
34
33
  required: true,
35
34
  message: '请输入id',
36
35
  },
37
- };
38
- await new Validator(params).validate(ctx.request.body);
39
- };
40
-
36
+ }
37
+ await new Validator(params).validate(ctx.request.body)
38
+ }
@@ -1,4 +1,4 @@
1
- const { Sequelize } = require('multiple-quick-koa')
1
+ const { Sequelize } = require('q-koa')
2
2
 
3
3
  exports.openid = {
4
4
  type: Sequelize.STRING,
@@ -1,4 +1,4 @@
1
- const { getAppByCtx, lodash } = require('multiple-quick-koa')
1
+ const { getAppByCtx, lodash } = require('q-koa')
2
2
 
3
3
  exports.update = async (ctx) => {
4
4
  const { app } = getAppByCtx(ctx)
@@ -1,4 +1,4 @@
1
- const { Sequelize, Random } = require('multiple-quick-koa')
1
+ const { Sequelize, Random } = require('q-koa')
2
2
 
3
3
  exports.openid = {
4
4
  type: Sequelize.STRING,
@@ -1,15 +1,15 @@
1
- const { Sequelize } = require('multiple-quick-koa');
1
+ const { Sequelize } = require('q-koa')
2
2
 
3
3
  exports.name = {
4
4
  type: Sequelize.STRING,
5
5
  comment: '名字',
6
6
  allowNull: false,
7
7
  defaultValue: '',
8
- };
8
+ }
9
9
 
10
10
  exports.key = {
11
11
  type: Sequelize.STRING,
12
12
  comment: 'key',
13
13
  allowNull: false,
14
14
  defaultValue: '',
15
- };
15
+ }
@@ -1,4 +1,4 @@
1
- const { Sequelize } = require('multiple-quick-koa');
1
+ const { Sequelize } = require('q-koa')
2
2
 
3
3
  exports.name = {
4
4
  type: Sequelize.STRING,
@@ -13,15 +13,14 @@ exports.name = {
13
13
  msg: '名字不允许为空',
14
14
  },
15
15
  },
16
- };
17
-
16
+ }
18
17
 
19
18
  exports.lang_id = {
20
19
  type: Sequelize.INTEGER(11),
21
20
  comment: '语言',
22
21
  allowNull: false,
23
22
  defaultValue: 1,
24
- };
23
+ }
25
24
 
26
25
  exports.key = {
27
26
  type: Sequelize.STRING,
@@ -36,7 +35,7 @@ exports.key = {
36
35
  msg: 'key值不允许为空',
37
36
  },
38
37
  },
39
- };
38
+ }
40
39
 
41
40
  exports.value = {
42
41
  type: Sequelize.STRING,
@@ -51,4 +50,4 @@ exports.value = {
51
50
  msg: 'value值不允许为空',
52
51
  },
53
52
  },
54
- };
53
+ }
@@ -1,4 +1,4 @@
1
- const { getAppByCtx } = require('multiple-quick-koa')
1
+ const { getAppByCtx } = require('q-koa')
2
2
 
3
3
  exports.clearWeixin = async (ctx) => {
4
4
  const { app } = getAppByCtx(ctx)
@@ -1,4 +1,4 @@
1
- const { Sequelize } = require('multiple-quick-koa')
1
+ const { Sequelize } = require('q-koa')
2
2
 
3
3
  exports.url = {
4
4
  type: Sequelize.STRING,
@@ -1,4 +1,4 @@
1
- const { getAppByCtx, lodash } = require('multiple-quick-koa')
1
+ const { getAppByCtx, lodash } = require('q-koa')
2
2
 
3
3
  const fs = require('fs')
4
4
  const path = require('path')
@@ -1,4 +1,4 @@
1
- const { Sequelize } = require('multiple-quick-koa')
1
+ const { Sequelize } = require('q-koa')
2
2
 
3
3
  exports.model = {
4
4
  type: Sequelize.STRING,
@@ -1,6 +1,4 @@
1
- const {
2
- Validator
3
- } = require('multiple-quick-koa');
1
+ const { Validator } = require('q-koa')
4
2
 
5
3
  exports.getModel = async (ctx) => {
6
4
  const params = {
@@ -9,9 +7,9 @@ exports.getModel = async (ctx) => {
9
7
  required: true,
10
8
  message: '请输入model',
11
9
  },
12
- };
13
- await new Validator(params).validate(ctx.request.body);
14
- };
10
+ }
11
+ await new Validator(params).validate(ctx.request.body)
12
+ }
15
13
 
16
14
  exports.createModel = async (ctx) => {
17
15
  const params = {
@@ -25,10 +23,9 @@ exports.createModel = async (ctx) => {
25
23
  required: true,
26
24
  message: '请输入desc详情',
27
25
  },
28
- };
29
- await new Validator(params).validate(ctx.request.body);
30
- };
31
-
26
+ }
27
+ await new Validator(params).validate(ctx.request.body)
28
+ }
32
29
 
33
30
  exports.createFile = async (ctx) => {
34
31
  const params = {
@@ -37,6 +34,6 @@ exports.createFile = async (ctx) => {
37
34
  required: true,
38
35
  message: '请输入plugin',
39
36
  },
40
- };
41
- await new Validator(params).validate(ctx.request.body);
42
- };
37
+ }
38
+ await new Validator(params).validate(ctx.request.body)
39
+ }
@@ -1,4 +1,4 @@
1
- const { Sequelize, Random } = require('multiple-quick-koa')
1
+ const { Sequelize, Random } = require('q-koa')
2
2
 
3
3
  exports.model_id = {
4
4
  type: Sequelize.INTEGER(11),
@@ -1,4 +1,4 @@
1
- const { Sequelize, Random } = require('multiple-quick-koa')
1
+ const { Sequelize, Random } = require('q-koa')
2
2
 
3
3
  exports.openid = {
4
4
  type: Sequelize.STRING,
@@ -1,4 +1,4 @@
1
- const { Sequelize } = require('multiple-quick-koa')
1
+ const { Sequelize } = require('q-koa')
2
2
 
3
3
  exports.name = {
4
4
  type: Sequelize.STRING,
@@ -1,4 +1,4 @@
1
- const { getAppByCtx } = require('multiple-quick-koa')
1
+ const { getAppByCtx } = require('q-koa')
2
2
 
3
3
  exports.init = async (ctx) => {
4
4
  const { app } = getAppByCtx(ctx)
@@ -1,4 +1,4 @@
1
- const { Sequelize, Random } = require('multiple-quick-koa')
1
+ const { Sequelize, Random } = require('q-koa')
2
2
 
3
3
  exports.name = {
4
4
  type: Sequelize.STRING,
@@ -1,4 +1,4 @@
1
- const { getAppByCtx } = require('multiple-quick-koa')
1
+ const { getAppByCtx } = require('q-koa')
2
2
 
3
3
  exports.edit = async (ctx) => {
4
4
  const { app, appName } = getAppByCtx(ctx)
@@ -1,5 +1,4 @@
1
- const { Sequelize, Random } = require('multiple-quick-koa');
2
-
1
+ const { Sequelize, Random } = require('q-koa')
3
2
 
4
3
  exports.role_id = {
5
4
  type: Sequelize.MEDIUMINT.UNSIGNED,
@@ -8,9 +7,9 @@ exports.role_id = {
8
7
  is_mock: true,
9
8
  defaultValue: 0,
10
9
  sortOrder: 1,
11
- mock: () => Random.integer(1,5),
12
- unique:'compositeIndex'
13
- };
10
+ mock: () => Random.integer(1, 5),
11
+ unique: 'compositeIndex',
12
+ }
14
13
 
15
14
  exports.permission_id = {
16
15
  type: Sequelize.MEDIUMINT.UNSIGNED,
@@ -19,6 +18,6 @@ exports.permission_id = {
19
18
  is_mock: true,
20
19
  defaultValue: 0,
21
20
  sortOrder: 2,
22
- mock: () => Random.integer(1,5),
23
- unique:'compositeIndex'
24
- };
21
+ mock: () => Random.integer(1, 5),
22
+ unique: 'compositeIndex',
23
+ }
@@ -1,4 +1,4 @@
1
- const { getAppByCtx, lodash } = require('multiple-quick-koa')
1
+ const { getAppByCtx, lodash } = require('q-koa')
2
2
 
3
3
  exports.bulkUpdate = async (ctx) => {
4
4
  const { app, appName } = getAppByCtx(ctx)
@@ -1,4 +1,4 @@
1
- const { Sequelize, Random } = require('multiple-quick-koa')
1
+ const { Sequelize, Random } = require('q-koa')
2
2
 
3
3
  exports.name = {
4
4
  type: Sequelize.STRING,
@@ -1,4 +1,4 @@
1
- const { getAppByCtx, getConfig } = require('multiple-quick-koa')
1
+ const { getAppByCtx, getConfig } = require('q-koa')
2
2
 
3
3
  exports.upsert = async (ctx) => {
4
4
  const { app } = getAppByCtx(ctx)
@@ -1,4 +1,4 @@
1
- const { getAppByCtx } = require('multiple-quick-koa')
1
+ const { getAppByCtx } = require('q-koa')
2
2
  const axios = require('axios')
3
3
 
4
4
  exports.bulkUpdate = async (ctx) => {
@@ -1,4 +1,4 @@
1
- const { Sequelize, Random, lodash, moment } = require('multiple-quick-koa')
1
+ const { Sequelize, Random, lodash, moment } = require('q-koa')
2
2
 
3
3
  exports.name = {
4
4
  type: Sequelize.STRING(),
@@ -1,5 +1,4 @@
1
- const { Validator,getAppByCtx } = require('multiple-quick-koa');
2
-
1
+ const { Validator, getAppByCtx } = require('q-koa')
3
2
 
4
3
  exports.bulkUpdate = async (ctx) => {
5
4
  const params = {
@@ -8,22 +7,17 @@ exports.bulkUpdate = async (ctx) => {
8
7
  required: true,
9
8
  message: '请输入list',
10
9
  },
11
- };
12
- await new Validator(params).validate(ctx.request.body);
13
- };
10
+ }
11
+ await new Validator(params).validate(ctx.request.body)
12
+ }
14
13
 
15
- exports.upsert = async ctx => {
16
- const {
17
- app
18
- } = getAppByCtx(ctx);
14
+ exports.upsert = async (ctx) => {
15
+ const { app } = getAppByCtx(ctx)
19
16
 
20
- const {
21
- id,
22
- parent_id
23
- } = ctx.request.body
17
+ const { id, parent_id } = ctx.request.body
24
18
 
25
19
  if (id && parent_id && id === parent_id) throw new Error('不能分类到自己')
26
- };
20
+ }
27
21
 
28
22
  exports.copyOther = async (ctx) => {
29
23
  const params = {
@@ -32,11 +26,11 @@ exports.copyOther = async (ctx) => {
32
26
  required: true,
33
27
  message: '请输入type, 需要复制哪个code',
34
28
  },
35
- source:{
29
+ source: {
36
30
  type: 'string',
37
31
  required: true,
38
32
  message: '请输入source, 需要从哪个项目复制哪个(记得开启)',
39
- }
40
- };
41
- await new Validator(params).validate(ctx.request.body);
42
- };
33
+ },
34
+ }
35
+ await new Validator(params).validate(ctx.request.body)
36
+ }
@@ -3,12 +3,7 @@ const path = require('path')
3
3
  const { VM } = require('vm2')
4
4
  const axios = require('axios')
5
5
  const cheerio = require('cheerio')
6
- const {
7
- lodash,
8
- getAppByCtx,
9
- getConfig,
10
- Sequelize,
11
- } = require('multiple-quick-koa')
6
+ const { lodash, getAppByCtx, getConfig, Sequelize } = require('q-koa')
12
7
 
13
8
  exports.initModel = async (ctx) => {
14
9
  const { app } = getAppByCtx(ctx)
@@ -1,4 +1,4 @@
1
- const { getConfig, lodash } = require('multiple-quick-koa')
1
+ const { getConfig, lodash } = require('q-koa')
2
2
  const formatPostFunction = (str) => `eval(${str})`
3
3
  const nodeVm = require('vm')
4
4
 
@@ -1,4 +1,4 @@
1
- const { Validator, getAppByCtx } = require('multiple-quick-koa');
1
+ const { Validator, getAppByCtx } = require('q-koa')
2
2
 
3
3
  exports.initModel = async (ctx) => {
4
4
  const params = {
@@ -7,34 +7,40 @@ exports.initModel = async (ctx) => {
7
7
  required: true,
8
8
  message: '请输入model',
9
9
  },
10
- };
11
- await new Validator(params).validate(ctx.request.body);
12
- };
10
+ }
11
+ await new Validator(params).validate(ctx.request.body)
12
+ }
13
13
 
14
14
  exports.showAllSchemas = async (ctx) => {
15
- const {app,appName} = getAppByCtx(ctx)
15
+ const { app, appName } = getAppByCtx(ctx)
16
16
 
17
17
  const params = {
18
18
  model: {
19
19
  type: 'string',
20
20
  required: true,
21
21
  message: '请输入model',
22
- validator: (rule, value) => ((app[appName].model && app[appName].model[value]) ? Promise.resolve() : Promise.reject('没有这个模型')),
22
+ validator: (rule, value) =>
23
+ app[appName].model && app[appName].model[value]
24
+ ? Promise.resolve()
25
+ : Promise.reject('没有这个模型'),
23
26
  },
24
- };
25
- await new Validator(params).validate(ctx.request.body);
26
- };
27
+ }
28
+ await new Validator(params).validate(ctx.request.body)
29
+ }
27
30
 
28
31
  exports.dropModel = async (ctx) => {
29
- const {app,appName} = getAppByCtx(ctx)
32
+ const { app, appName } = getAppByCtx(ctx)
30
33
 
31
34
  const params = {
32
35
  model: {
33
36
  type: 'string',
34
37
  required: true,
35
38
  message: '请输入model',
36
- validator: (rule, value) => ((app[appName].model && app[appName].model[value]) ? Promise.resolve() : Promise.reject('没有这个模型')),
39
+ validator: (rule, value) =>
40
+ app[appName].model && app[appName].model[value]
41
+ ? Promise.resolve()
42
+ : Promise.reject('没有这个模型'),
37
43
  },
38
- };
39
- await new Validator(params).validate(ctx.request.body);
40
- };
44
+ }
45
+ await new Validator(params).validate(ctx.request.body)
46
+ }
@@ -1,4 +1,4 @@
1
- const { Sequelize, Random } = require('multiple-quick-koa')
1
+ const { Sequelize, Random } = require('q-koa')
2
2
 
3
3
  exports.name = {
4
4
  type: Sequelize.STRING,
@@ -1,9 +1,4 @@
1
- const {
2
- getAppByCtx,
3
- getConfig,
4
- getService,
5
- lodash,
6
- } = require('multiple-quick-koa')
1
+ const { getAppByCtx, getConfig, getService, lodash } = require('q-koa')
7
2
 
8
3
  const util = require('util')
9
4
  const axios = require('axios')
@@ -1,4 +1,4 @@
1
- const { Sequelize } = require('multiple-quick-koa')
1
+ const { Sequelize } = require('q-koa')
2
2
 
3
3
  exports.openid = {
4
4
  type: Sequelize.STRING,