q-koa 11.2.1 → 11.2.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.
|
@@ -62,7 +62,7 @@ exports.login = async (ctx) => {
|
|
|
62
62
|
name,
|
|
63
63
|
},
|
|
64
64
|
attributes: {
|
|
65
|
-
exclude: ['createdid', 'updated_at', 'created_at'],
|
|
65
|
+
exclude: ['createdid', 'updated_at', 'created_at', 'password'],
|
|
66
66
|
},
|
|
67
67
|
include: [
|
|
68
68
|
{
|
|
@@ -91,6 +91,7 @@ exports.login = async (ctx) => {
|
|
|
91
91
|
exports.checkLogin = async (ctx) => {
|
|
92
92
|
const { app, appName } = getAppByCtx(ctx)
|
|
93
93
|
const { host } = ctx.request
|
|
94
|
+
|
|
94
95
|
const is_dev = host.startsWith('localhost')
|
|
95
96
|
const permissionList = await app.model.permission.findAll({
|
|
96
97
|
attributes: {
|
|
@@ -123,9 +124,10 @@ exports.checkLogin = async (ctx) => {
|
|
|
123
124
|
const result = await app.model.administrator.findOne({
|
|
124
125
|
where: {
|
|
125
126
|
id: ctx.request[`${appName}-user`].id,
|
|
127
|
+
password: ctx.request[`${appName}-user`].password || '',
|
|
126
128
|
},
|
|
127
129
|
attributes: {
|
|
128
|
-
exclude: ['createdid', 'updated_at', 'created_at'],
|
|
130
|
+
exclude: ['createdid', 'updated_at', 'created_at', 'password'],
|
|
129
131
|
},
|
|
130
132
|
include: [
|
|
131
133
|
{
|
|
@@ -146,6 +148,7 @@ exports.checkLogin = async (ctx) => {
|
|
|
146
148
|
const tokenResult = {
|
|
147
149
|
id: result.id,
|
|
148
150
|
name: result.name,
|
|
151
|
+
password: result.password,
|
|
149
152
|
}
|
|
150
153
|
|
|
151
154
|
const token = await app.sign({
|
|
@@ -257,10 +260,6 @@ exports.getPermission = async (ctx) => {
|
|
|
257
260
|
role_id: administrator.role_id,
|
|
258
261
|
},
|
|
259
262
|
})
|
|
260
|
-
console.log(
|
|
261
|
-
'permission',
|
|
262
|
-
permission.map((item) => item.permission_id)
|
|
263
|
-
)
|
|
264
263
|
|
|
265
264
|
const permissionList = await app.model.permission.findAll()
|
|
266
265
|
const administratorData = {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
name: '支付方式',
|
|
3
|
+
belongs: 'setting',
|
|
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,47 @@
|
|
|
1
|
+
const { Sequelize, Random } = require('q-koa')
|
|
2
|
+
|
|
3
|
+
exports.name = {
|
|
4
|
+
type: Sequelize.STRING,
|
|
5
|
+
comment: '名字',
|
|
6
|
+
allowNull: false,
|
|
7
|
+
is_mock: false,
|
|
8
|
+
defaultValue: '',
|
|
9
|
+
sortOrder: 1,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
exports.desc = {
|
|
13
|
+
type: Sequelize.STRING,
|
|
14
|
+
comment: '介绍',
|
|
15
|
+
allowNull: false,
|
|
16
|
+
is_mock: false,
|
|
17
|
+
defaultValue: '',
|
|
18
|
+
sortOrder: 2,
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
exports.key = {
|
|
22
|
+
type: Sequelize.STRING,
|
|
23
|
+
comment: 'key',
|
|
24
|
+
allowNull: false,
|
|
25
|
+
is_mock: false,
|
|
26
|
+
defaultValue: '',
|
|
27
|
+
sortOrder: 3,
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
exports.image = {
|
|
31
|
+
type: Sequelize.STRING(300),
|
|
32
|
+
comment: '图标',
|
|
33
|
+
allowNull: false,
|
|
34
|
+
is_mock: false,
|
|
35
|
+
defaultValue: '',
|
|
36
|
+
sortOrder: 4,
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
exports.is_on = {
|
|
40
|
+
type: Sequelize.BOOLEAN,
|
|
41
|
+
comment: '是否开启',
|
|
42
|
+
allowNull: false,
|
|
43
|
+
is_mock: true,
|
|
44
|
+
defaultValue: true,
|
|
45
|
+
sortOrder: 5,
|
|
46
|
+
mock: () => Random.boolean(),
|
|
47
|
+
}
|
|
@@ -1701,3 +1701,24 @@ exports.removereceiver = async (ctx) => {
|
|
|
1701
1701
|
})
|
|
1702
1702
|
return ctx.SUCCESS(res)
|
|
1703
1703
|
}
|
|
1704
|
+
|
|
1705
|
+
exports.setMsgJumpPath = async (ctx) => {
|
|
1706
|
+
const { app, appName } = getAppByCtx(ctx)
|
|
1707
|
+
const appConfig = getConfig(app)
|
|
1708
|
+
|
|
1709
|
+
const {config = 'weixin_mp' ,path='pages/index/index'} = ctx.request.body
|
|
1710
|
+
const { app_id, app_secrect } = await appConfig.getObject(config)
|
|
1711
|
+
|
|
1712
|
+
const weixinMp = new WeixinMp({
|
|
1713
|
+
appid: app_id,
|
|
1714
|
+
secrect: app_secrect,
|
|
1715
|
+
})
|
|
1716
|
+
|
|
1717
|
+
weixinMp.init()
|
|
1718
|
+
|
|
1719
|
+
const result = await weixinMp.setMsgJumpPath({
|
|
1720
|
+
path,
|
|
1721
|
+
})
|
|
1722
|
+
|
|
1723
|
+
ctx.SUCCESS('ok')
|
|
1724
|
+
}
|