q-koa 10.6.2 → 10.6.4

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.
@@ -0,0 +1,17 @@
1
+ module.exports = {
2
+ name: '后台导航',
3
+ belongs: 'auth',
4
+ multiple: false,
5
+ availableSort: true,
6
+ order: [],
7
+ select: [],
8
+ excludes: [],
9
+ limit: 40,
10
+ defaultOrder: [{ sort: 'ascending', type: 'sortOrder' }],
11
+ comment: {},
12
+ sortOrder: 1,
13
+ reference: [],
14
+ excludeAuth: [],
15
+ initList: [],
16
+ personal: [{ key: 'init_routes', name: '初始化', width: 200, common: true }],
17
+ }
@@ -121,3 +121,34 @@ exports.is_control = {
121
121
  controlInline: true,
122
122
  },
123
123
  }
124
+
125
+ exports.extra = {
126
+ type: Sequelize.JSON,
127
+ comment: 'extra',
128
+ allowNull: false,
129
+ is_mock: false,
130
+ defaultValue: {},
131
+ sortOrder: 9,
132
+ set: function (value) {
133
+ try {
134
+ const dataValue = typeof value === 'object' ? value : JSON.parse(value)
135
+ this.setDataValue('extra', dataValue)
136
+ console.log(dataValue)
137
+ } catch {
138
+ throw new Error('extra值不合法')
139
+ }
140
+ },
141
+ get: function () {
142
+ try {
143
+ const value = this.getDataValue('extra')
144
+ const dataValue =
145
+ typeof value === 'object' ? value || {} : JSON.parse(value)
146
+ return dataValue
147
+ } catch {
148
+ return {}
149
+ }
150
+ },
151
+ extra: {
152
+ type: 'json-editor',
153
+ },
154
+ }
@@ -143,17 +143,13 @@ exports.login = async (ctx) => {
143
143
  ),
144
144
  }
145
145
  result = await app.model.user.findOne({
146
- where: {
147
- id: result.id,
148
- },
146
+ where,
149
147
  attributes,
150
148
  include,
151
149
  })
152
150
  } else {
153
151
  result = await app.model.user.findOne({
154
- where: {
155
- id: result.id,
156
- },
152
+ where,
157
153
  include: includeDefault,
158
154
  })
159
155
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "10.6.2",
3
+ "version": "10.6.4",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {