q-koa 10.7.7 → 10.8.0

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.
package/core/config.js CHANGED
@@ -138,18 +138,20 @@ module.exports = {
138
138
  router.get('/cache/get', app.controller.cache.get)
139
139
  router.get('/cache/clear', app.controller.cache.clear)
140
140
  }
141
+ if (app.model.weixin) {
142
+ router.get('/weixin/h5_login', app.controller.weixin.h5_login)
143
+ router.get(
144
+ '/weixin/h5_login_callback',
145
+ app.controller.weixin.h5_login_callback
146
+ )
147
+ router.get(
148
+ '/weixin/h5_login_info_callback',
149
+ app.controller.weixin.h5_login_info_callback
150
+ )
151
+ router.get('/weixin/messagePush', app.controller.weixin.messagePush)
152
+ }
141
153
 
142
- router.get('/weixin/h5_login', app.controller.weixin.h5_login)
143
- router.get(
144
- '/weixin/h5_login_callback',
145
- app.controller.weixin.h5_login_callback
146
- )
147
- router.get(
148
- '/weixin/h5_login_info_callback',
149
- app.controller.weixin.h5_login_info_callback
150
- )
151
154
  router.get('/common/getAppConfig', app.controller.common.getAppConfig)
152
- router.get('/weixin/messagePush', app.controller.weixin.messagePush)
153
155
  router.get('/common/createQr', app.controller.common.createQr)
154
156
  router.get('/lanhu/:str', async (ctx) => {
155
157
  const { str } = ctx.params
@@ -1,5 +1,42 @@
1
1
  module.exports = {
2
- name: '语言包',
3
- belongs: 'setting',
4
- tab: 'lang_id',
5
- };
2
+ name: '语言设置',
3
+ belongs: 'page',
4
+ multiple: false,
5
+ availableSort: false,
6
+ order: [],
7
+ referenceSelect: [],
8
+ select: [
9
+ { key: 'name', symbol: '$like' },
10
+ {
11
+ key: 'type',
12
+ admin: {
13
+ name: 'admin',
14
+ },
15
+ },
16
+ ],
17
+ excludes: [],
18
+ limit: 20,
19
+ defaultOrder: [{ sort: 'descending', type: 'id' }],
20
+ comment: {},
21
+ sortOrder: 1,
22
+ reference: [
23
+ { key: 'operate_language', name: '设置', width: 300, common: true },
24
+ ],
25
+ excludeAuth: [],
26
+ include: ((app) => {
27
+ return [
28
+ {
29
+ model: app.model.language_value,
30
+ },
31
+ ]
32
+ }).toString(),
33
+ initList: ['language_type'],
34
+ editInline: {},
35
+ autoData: {},
36
+ is_split: false,
37
+ is_split_count: false,
38
+ show_virtual: false,
39
+ modelQuery: {},
40
+ deleteCheckList: [],
41
+ bulkCreateList: [],
42
+ }
@@ -1,53 +1,21 @@
1
- const { Sequelize } = require('q-koa')
1
+ const { Sequelize, Random } = require('q-koa')
2
2
 
3
3
  exports.name = {
4
4
  type: Sequelize.STRING,
5
- comment: '名字',
5
+ comment: '说明',
6
6
  allowNull: false,
7
+ is_mock: true,
7
8
  defaultValue: '',
8
- validate: {
9
- notNull: {
10
- msg: '名字不允许为空',
11
- },
12
- notEmpty: {
13
- msg: '名字不允许为空',
14
- },
15
- },
9
+ sortOrder: 1,
10
+ mock: () => Random.ctitle(),
16
11
  }
17
12
 
18
- exports.lang_id = {
19
- type: Sequelize.INTEGER(11),
20
- comment: '语言',
13
+ exports.type = {
14
+ type: Sequelize.ENUM('input', 'textarea', 'content'),
15
+ comment: '类型',
21
16
  allowNull: false,
22
- defaultValue: 1,
23
- }
24
-
25
- exports.key = {
26
- type: Sequelize.STRING,
27
- comment: 'key值',
28
- allowNull: false,
29
- defaultValue: '',
30
- validate: {
31
- notNull: {
32
- msg: 'key值不允许为空',
33
- },
34
- notEmpty: {
35
- msg: 'key值不允许为空',
36
- },
37
- },
38
- }
39
-
40
- exports.value = {
41
- type: Sequelize.STRING,
42
- comment: 'value值',
43
- allowNull: false,
44
- defaultValue: '',
45
- validate: {
46
- notNull: {
47
- msg: 'value值不允许为空',
48
- },
49
- notEmpty: {
50
- msg: 'value值不允许为空',
51
- },
52
- },
17
+ is_mock: true,
18
+ defaultValue: 'input',
19
+ sortOrder: 2,
20
+ mock: () => ['input', 'textarea', 'content'][Random.integer(0, 2)],
53
21
  }
@@ -0,0 +1,25 @@
1
+ module.exports = {
2
+ name: '语言包',
3
+ belongs: 'page',
4
+ multiple: false,
5
+ availableSort: false,
6
+ order: [],
7
+ referenceSelect: [],
8
+ select: [],
9
+ excludes: [],
10
+ limit: 20,
11
+ defaultOrder: [],
12
+ comment: {},
13
+ sortOrder: 1,
14
+ reference: [],
15
+ excludeAuth: [],
16
+ initList: [],
17
+ editInline: {},
18
+ autoData: {},
19
+ is_split: false,
20
+ is_split_count: false,
21
+ show_virtual: false,
22
+ modelQuery: {},
23
+ deleteCheckList: [],
24
+ bulkCreateList: [],
25
+ };
@@ -0,0 +1,42 @@
1
+ const { Sequelize, Random } = require('q-koa');
2
+
3
+
4
+ exports.name = {
5
+ type: Sequelize.STRING,
6
+ comment: '名字',
7
+ allowNull: false,
8
+ is_mock: true,
9
+ defaultValue: '',
10
+ sortOrder: 1,
11
+ mock: () => Random.ctitle(),
12
+ }
13
+
14
+ exports.ename = {
15
+ type: Sequelize.STRING,
16
+ comment: '名字',
17
+ allowNull: false,
18
+ is_mock: true,
19
+ defaultValue: '',
20
+ sortOrder: 2,
21
+ mock: () => Random.ctitle(),
22
+ }
23
+
24
+ exports.key = {
25
+ type: Sequelize.STRING,
26
+ comment: '名字',
27
+ allowNull: false,
28
+ is_mock: true,
29
+ defaultValue: '',
30
+ sortOrder: 3,
31
+ mock: () => Random.ctitle(),
32
+ }
33
+
34
+ exports.is_on = {
35
+ type: Sequelize.BOOLEAN,
36
+ comment: '是否',
37
+ allowNull: false,
38
+ is_mock: true,
39
+ defaultValue: true,
40
+ sortOrder: 4,
41
+ mock: () => Random.boolean(),
42
+ }
@@ -0,0 +1,21 @@
1
+ module.exports = {
2
+ name: '语言包详情',
3
+ belongs: 'page',
4
+ multiple: false,
5
+ availableSort: false,
6
+ order: [],
7
+ referenceSelect: [],
8
+ select: [],
9
+ excludes: [],
10
+ limit: 20,
11
+ defaultOrder: [],
12
+ sortOrder: 1,
13
+ reference: [],
14
+ excludeAuth: [],
15
+ initList: [],
16
+ is_split: false,
17
+ is_split_count: false,
18
+ show_virtual: false,
19
+ deleteCheckList: [],
20
+ bulkCreateList: [],
21
+ };
@@ -0,0 +1,34 @@
1
+ const { Sequelize, Random } = require('q-koa')
2
+
3
+ exports.language_id = {
4
+ type: Sequelize.MEDIUMINT.UNSIGNED,
5
+ comment: '语言设置',
6
+ allowNull: false,
7
+ is_mock: true,
8
+ defaultValue: 0,
9
+ sortOrder: 1,
10
+ mock: () => Random.integer(1, 5),
11
+ }
12
+
13
+ exports.content = {
14
+ type: Sequelize.TEXT('long'),
15
+ comment: '介绍',
16
+ allowNull: true,
17
+ is_mock: true,
18
+ defaultValue: null,
19
+ sortOrder: 3,
20
+ mock: () => Random.cparagraph(),
21
+ get: function () {
22
+ return this.getDataValue('content') || ''
23
+ },
24
+ }
25
+
26
+ exports.language_type_id = {
27
+ type: Sequelize.MEDIUMINT.UNSIGNED,
28
+ comment: '语言包',
29
+ allowNull: false,
30
+ is_mock: true,
31
+ defaultValue: 1,
32
+ sortOrder: 4,
33
+ mock: () => Random.integer(1, 5),
34
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "10.7.7",
3
+ "version": "10.8.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,4 +0,0 @@
1
- module.exports = {
2
- name: '语言',
3
- belongs: 'setting',
4
- };
@@ -1,15 +0,0 @@
1
- const { Sequelize } = require('q-koa')
2
-
3
- exports.name = {
4
- type: Sequelize.STRING,
5
- comment: '名字',
6
- allowNull: false,
7
- defaultValue: '',
8
- }
9
-
10
- exports.key = {
11
- type: Sequelize.STRING,
12
- comment: 'key',
13
- allowNull: false,
14
- defaultValue: '',
15
- }