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 +1 -1
- package/core/config.js +1 -0
- package/core/file/plugins/cache/controller.js +7 -0
- package/package.json +1 -1
package/core/app.js
CHANGED
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 =
|