q-koa 13.1.5 → 13.1.7
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/file/plugins/app/controller.js +0 -1
- package/core/file/plugins/douyin/controller.js +0 -1
- package/core/file/plugins/setting/afterExecute.js +30 -4
- package/core/file/plugins/table_setting/config.js +30 -0
- package/core/file/plugins/toutiao/controller.js +0 -3
- package/core/file/plugins/user/controller.js +0 -3
- package/core/file/plugins/weixin/controller.js +0 -5
- package/package.json +1 -1
|
@@ -1,14 +1,40 @@
|
|
|
1
|
-
const { getAppByCtx, getConfig } = require('q-koa')
|
|
1
|
+
const { getAppByCtx, getConfig, lodash, is_dev } = require('q-koa')
|
|
2
2
|
|
|
3
3
|
exports.upsert = async (ctx) => {
|
|
4
4
|
const { app } = getAppByCtx(ctx)
|
|
5
5
|
const appConfig = getConfig(app)
|
|
6
|
-
|
|
6
|
+
const { id } = ctx.request.body
|
|
7
|
+
if (!id) return
|
|
8
|
+
const current_list = await app.model.setting.findAll({
|
|
9
|
+
where: {
|
|
10
|
+
id,
|
|
11
|
+
},
|
|
12
|
+
})
|
|
13
|
+
if (
|
|
14
|
+
current_list.some(
|
|
15
|
+
(o) => (o.extra && !lodash.isEmpty(o.extra)) || o.is_front || o.is_cache
|
|
16
|
+
)
|
|
17
|
+
) {
|
|
18
|
+
appConfig.update()
|
|
19
|
+
}
|
|
7
20
|
}
|
|
8
21
|
|
|
9
22
|
exports.bulkUpdate = async (ctx) => {
|
|
10
23
|
const { app } = getAppByCtx(ctx)
|
|
11
|
-
|
|
12
24
|
const appConfig = getConfig(app)
|
|
13
|
-
|
|
25
|
+
const { list = [] } = ctx.request.body
|
|
26
|
+
|
|
27
|
+
if (list.length === 0) return
|
|
28
|
+
const current_list = await app.model.setting.findAll({
|
|
29
|
+
where: {
|
|
30
|
+
id: list.map((item) => item.id),
|
|
31
|
+
},
|
|
32
|
+
})
|
|
33
|
+
if (
|
|
34
|
+
current_list.some(
|
|
35
|
+
(o) => (o.extra && !lodash.isEmpty(o.extra)) || o.is_front || o.is_cache
|
|
36
|
+
)
|
|
37
|
+
) {
|
|
38
|
+
appConfig.update()
|
|
39
|
+
}
|
|
14
40
|
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
name: '设置',
|
|
3
|
+
belongs: 'page',
|
|
4
|
+
multiple: false,
|
|
5
|
+
model: 'setting',
|
|
6
|
+
availableSort: false,
|
|
7
|
+
order: [],
|
|
8
|
+
referenceSelect: [],
|
|
9
|
+
select: ['id', 'code', 'name', 'is_front', 'is_cache', 'is_control', 'extra'],
|
|
10
|
+
excludes: [],
|
|
11
|
+
limit: 20,
|
|
12
|
+
defaultOrder: [],
|
|
13
|
+
comment: {},
|
|
14
|
+
sortOrder: 1,
|
|
15
|
+
reference: [],
|
|
16
|
+
excludeAuth: [],
|
|
17
|
+
initList: [],
|
|
18
|
+
initTableList: [],
|
|
19
|
+
editInline: {},
|
|
20
|
+
autoData: {},
|
|
21
|
+
is_split: false,
|
|
22
|
+
is_split_count: false,
|
|
23
|
+
show_virtual: true,
|
|
24
|
+
modelQuery: {},
|
|
25
|
+
modelUpsert: {},
|
|
26
|
+
modelDelete: {},
|
|
27
|
+
deleteCheckList: [],
|
|
28
|
+
bulkCreateList: [],
|
|
29
|
+
indexList: [],
|
|
30
|
+
}
|
|
@@ -161,12 +161,9 @@ exports.login = async (ctx) => {
|
|
|
161
161
|
],
|
|
162
162
|
})
|
|
163
163
|
|
|
164
|
-
console.log('result', result, app.include.user)
|
|
165
|
-
|
|
166
164
|
const tokenResult = {
|
|
167
165
|
id: result.id,
|
|
168
166
|
name: result.name,
|
|
169
|
-
mobile: result.mobile,
|
|
170
167
|
mp_user: result.mp_user
|
|
171
168
|
? {
|
|
172
169
|
openid: result.mp_user && result.mp_user.openid,
|
|
@@ -42,7 +42,6 @@ exports.login = async (ctx) => {
|
|
|
42
42
|
const tokenResult = {
|
|
43
43
|
id: result.id,
|
|
44
44
|
name: result.name,
|
|
45
|
-
mobile: result.mobile,
|
|
46
45
|
}
|
|
47
46
|
const token = await app.sign({
|
|
48
47
|
user: tokenResult,
|
|
@@ -194,7 +193,6 @@ exports.login = async (ctx) => {
|
|
|
194
193
|
const tokenResult = {
|
|
195
194
|
id: result.id,
|
|
196
195
|
name: result.name,
|
|
197
|
-
mobile: result.mobile,
|
|
198
196
|
mp_user: result.mp_user
|
|
199
197
|
? {
|
|
200
198
|
openid: result.mp_user && result.mp_user.openid,
|
|
@@ -433,7 +431,6 @@ exports.checkLogin = async (ctx) => {
|
|
|
433
431
|
const tokenResult = {
|
|
434
432
|
id: result.id,
|
|
435
433
|
name: result.name,
|
|
436
|
-
mobile: result.mobile,
|
|
437
434
|
mp_user: result.mp_user
|
|
438
435
|
? {
|
|
439
436
|
openid: result.mp_user && result.mp_user.openid,
|
|
@@ -131,7 +131,6 @@ exports.mp_getPhone = async (ctx) => {
|
|
|
131
131
|
const tokenResult = {
|
|
132
132
|
id: result.id,
|
|
133
133
|
name: result.name,
|
|
134
|
-
mobile: result.mobile,
|
|
135
134
|
mp_user: result.mp_user
|
|
136
135
|
? {
|
|
137
136
|
openid: result.mp_user && result.mp_user.openid,
|
|
@@ -253,7 +252,6 @@ exports.mp_getPhoneNew = async (ctx) => {
|
|
|
253
252
|
const tokenResult = {
|
|
254
253
|
id: result.id,
|
|
255
254
|
name: result.name,
|
|
256
|
-
mobile: result.mobile,
|
|
257
255
|
mp_user: result.mp_user
|
|
258
256
|
? {
|
|
259
257
|
openid: result.mp_user && result.mp_user.openid,
|
|
@@ -495,7 +493,6 @@ exports.mp_login = async (ctx) => {
|
|
|
495
493
|
const tokenResult = {
|
|
496
494
|
id: result.id,
|
|
497
495
|
name: result.name,
|
|
498
|
-
mobile: result.mobile,
|
|
499
496
|
mp_user: result.mp_user
|
|
500
497
|
? {
|
|
501
498
|
openid: result.mp_user && result.mp_user.openid,
|
|
@@ -675,7 +672,6 @@ exports.h5_login_callback = async (ctx) => {
|
|
|
675
672
|
const tokenResult = {
|
|
676
673
|
id: result.id,
|
|
677
674
|
name: result.name,
|
|
678
|
-
mobile: result.mobile,
|
|
679
675
|
mp_user: result.mp_user
|
|
680
676
|
? {
|
|
681
677
|
openid: result.mp_user && result.mp_user.openid,
|
|
@@ -810,7 +806,6 @@ exports.h5_login_info_callback = async (ctx) => {
|
|
|
810
806
|
const tokenResult = {
|
|
811
807
|
id: result.id,
|
|
812
808
|
name: result.name,
|
|
813
|
-
mobile: result.mobile,
|
|
814
809
|
mp_user: result.mp_user
|
|
815
810
|
? {
|
|
816
811
|
openid: result.mp_user && result.mp_user.openid,
|