q-koa 11.8.5 → 11.8.6
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/app.js
CHANGED
|
@@ -1099,6 +1099,24 @@ class APP {
|
|
|
1099
1099
|
$in: [Sequelize.literal(item.$in)],
|
|
1100
1100
|
}
|
|
1101
1101
|
}
|
|
1102
|
+
console.log(item.$lt)
|
|
1103
|
+
if (
|
|
1104
|
+
item.hasOwnProperty('$lt') &&
|
|
1105
|
+
typeof item.$lt === 'string'
|
|
1106
|
+
) {
|
|
1107
|
+
return {
|
|
1108
|
+
$lt: Sequelize.literal(item.$lt),
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
if (
|
|
1113
|
+
item.hasOwnProperty('$gt') &&
|
|
1114
|
+
typeof item.$gt === 'string'
|
|
1115
|
+
) {
|
|
1116
|
+
return {
|
|
1117
|
+
$gt: Sequelize.literal(item.$gt),
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1102
1120
|
return item
|
|
1103
1121
|
} else {
|
|
1104
1122
|
return item
|
|
@@ -53,9 +53,6 @@ exports.login = async (ctx) => {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
if (!checkLoginResult) throw new Error('账号密码错误')
|
|
56
|
-
const token = await app.sign({
|
|
57
|
-
user: checkLoginResult,
|
|
58
|
-
})
|
|
59
56
|
|
|
60
57
|
const result = await app.model.administrator.findOne({
|
|
61
58
|
where: {
|
|
@@ -74,6 +71,13 @@ exports.login = async (ctx) => {
|
|
|
74
71
|
],
|
|
75
72
|
})
|
|
76
73
|
const objResult = result.toJSON()
|
|
74
|
+
if (!objResult.role || !objResult.role.permission_id) {
|
|
75
|
+
throw new Error('无法登录,请重试')
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const token = await app.sign({
|
|
79
|
+
user: checkLoginResult,
|
|
80
|
+
})
|
|
77
81
|
return ctx.SUCCESS({
|
|
78
82
|
token,
|
|
79
83
|
user: {
|
|
@@ -74,6 +74,13 @@ exports.loadModel = async ({ app, appName }) => {
|
|
|
74
74
|
}
|
|
75
75
|
if (countNumber >= 500) {
|
|
76
76
|
disabledFindAllList = [...disabledFindAllList, result[i]]
|
|
77
|
+
const tableIndexList = await app.service.system.getTableIndex({
|
|
78
|
+
app,
|
|
79
|
+
model: result[i],
|
|
80
|
+
})
|
|
81
|
+
if (tableIndexList.length <= 1) {
|
|
82
|
+
console.warn(`${result[i]} count ${countNumber}没有索引`)
|
|
83
|
+
}
|
|
77
84
|
}
|
|
78
85
|
}
|
|
79
86
|
|