q-koa 10.8.5 → 10.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
@@ -344,7 +344,7 @@ class APP {
344
344
  if (typeof item === 'string') {
345
345
  return {
346
346
  app: item,
347
- db: item,
347
+ db: this.config.db.name || item,
348
348
  }
349
349
  } else {
350
350
  return item
package/core/config.js CHANGED
@@ -137,6 +137,7 @@ module.exports = {
137
137
  if (app.controller.cache) {
138
138
  router.get('/cache/get', app.controller.cache.get)
139
139
  router.get('/cache/clear', app.controller.cache.clear)
140
+ router.get('/cache/getAll', app.controller.cache.getAll)
140
141
  }
141
142
  if (app.model.weixin) {
142
143
  router.get('/weixin/h5_login', app.controller.weixin.h5_login)
@@ -1,5 +1,12 @@
1
1
  const { getAppByCtx, getUserByCtx, getConfig } = require('q-koa')
2
2
 
3
+ exports.getAll = async (ctx) => {
4
+ const { app, appName } = getAppByCtx(ctx)
5
+ const result = Object.keys(app.model).filter((model) => app.cache.get(model))
6
+ console.info(`cacheModel设置可CRUD同步更新`)
7
+ ctx.SUCCESS(result)
8
+ }
9
+
3
10
  exports.get = async (ctx) => {
4
11
  const { app, appName } = getAppByCtx(ctx)
5
12
  const key =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "10.8.5",
3
+ "version": "10.8.6",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {