q-koa 8.6.0 → 8.6.1

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.
@@ -24,6 +24,21 @@ exports.getObject = (config, app) => async (type) => {
24
24
  ) {
25
25
  return applicationList.find((item) => item.config === type)
26
26
  }
27
+
28
+ if (!applicationList) {
29
+ if (app.model.application) {
30
+ const result = await app.model.application.findAll()
31
+
32
+ if (result.length > 0) {
33
+ app.cache.set('application', JSON.parse(JSON.stringify(result)))
34
+
35
+ const target = result.find((item) => item.config === type)
36
+ if (target) {
37
+ return target
38
+ }
39
+ }
40
+ }
41
+ }
27
42
  }
28
43
  const obj = config.find((i) => i.code === type)
29
44
  if (!obj) throw new Error(`找不到${type}相关设置`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "8.6.0",
3
+ "version": "8.6.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {