diff --git a/api/app/lib/controllers/bigScreen/index .js b/api/app/lib/controllers/bigScreen/index .js index 2ce891f..25f2e62 100644 --- a/api/app/lib/controllers/bigScreen/index .js +++ b/api/app/lib/controllers/bigScreen/index .js @@ -77,18 +77,18 @@ const pumpInformation = async function (ctx) { const getPumpStation = async function (ctx) { try { console.log(ctx); - // const { key, methodType, field } = ctx.query; + const { key, methodType, field } = ctx.query; - // let res - // if (field) { - // res = await ctx.redis[methodType]("pumpStation_" + key, field) || [] - // } else { - // res = await ctx.redis[methodType]("pumpStation_" + key) || [] - // } + let res + if (field) { + res = await ctx.redis[methodType]("pumpStation_" + key, field) || [] + } else { + res = await ctx.redis[methodType]("pumpStation_" + key) || [] + } ctx.status = 200; - // ctx.body = JSON.parse(res) - ctx.body = [] + ctx.body = JSON.parse(res) + // ctx.body = [] } catch (error) { ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); ctx.status = 400; diff --git a/api/app/lib/routes/organization/index.js b/api/app/lib/routes/organization/index.js index ff71af8..426fa74 100644 --- a/api/app/lib/routes/organization/index.js +++ b/api/app/lib/routes/organization/index.js @@ -6,7 +6,7 @@ module.exports = function (app, router, opts) { try { - app.fs.api.logAttr['get/pump/station'] = { content: '获取所有站点信息', visible: true }; + app.fs.api.logAttr['GET/pump/station'] = { content: '获取所有站点信息', visible: true }; router.get('/pump1/station1', data.getPumpStation); @@ -16,7 +16,7 @@ module.exports = function (app, router, opts) { app.fs.api.logAttr['GET/pumpInformation'] = { content: '获取泵站信息', visible: true }; router.get('/pumpInformation', data.pumpInformation); - app.fs.api.logAttr['get/videoUrl'] = { content: '获取视频监控url', visible: true }; + app.fs.api.logAttr['GET/videoUrl'] = { content: '获取视频监控url', visible: true }; router.get('/videoUrl', data.getVideoUrl);