q-koa 11.2.4 → 11.2.5
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/utils/index.js +6 -5
- package/package.json +1 -1
package/core/file/utils/index.js
CHANGED
|
@@ -6,7 +6,8 @@ const findConfig = (type) => (item) =>
|
|
|
6
6
|
item.config === type ||
|
|
7
7
|
item.pay_config === type ||
|
|
8
8
|
(item.ToUserName && item.ToUserName === type) ||
|
|
9
|
-
(item.appId && item.appId === type)
|
|
9
|
+
(item.appId && item.appId === type) ||
|
|
10
|
+
(item.id && item.id === type)
|
|
10
11
|
|
|
11
12
|
exports.getSetting = (config) => (type) =>
|
|
12
13
|
config.find((i) => i.key === type).value
|
|
@@ -176,12 +177,12 @@ exports.getImageType = (fileBuffer) => {
|
|
|
176
177
|
return ''
|
|
177
178
|
}
|
|
178
179
|
|
|
179
|
-
exports.getAppConfig = async ({ app, config, key, app_id }) => {
|
|
180
|
-
if (!(app && (config || key || app_id))) return null
|
|
180
|
+
exports.getAppConfig = async ({ app, config, key, app_id, id }) => {
|
|
181
|
+
if (!(app && (config || key || app_id || id))) return null
|
|
181
182
|
const application =
|
|
182
183
|
app.cache.get('application') || (await app.model.application.findAll())
|
|
183
|
-
|
|
184
|
-
const target = application.find(findConfig(config || key || app_id))
|
|
184
|
+
console.log(id)
|
|
185
|
+
const target = application.find(findConfig(config || key || app_id || id))
|
|
185
186
|
|
|
186
187
|
return target || null
|
|
187
188
|
}
|