Browse Source

测试33333

master
wenlele 1 year ago
parent
commit
a68bed8921
  1. 19
      api/app/lib/controllers/bigScreen/index .js

19
api/app/lib/controllers/bigScreen/index .js

@ -76,16 +76,19 @@ const pumpInformation = async function (ctx) {
const getPumpStation = async function (ctx) { const getPumpStation = async function (ctx) {
try { try {
const { key, methodType, field } = ctx.query; console.log(ctx);
let res // const { key, methodType, field } = ctx.query;
if (field) {
res = await ctx.redis[methodType]("pumpStation_" + key, field) || [] // let res
} else { // if (field) {
res = await ctx.redis[methodType]("pumpStation_" + key) || [] // res = await ctx.redis[methodType]("pumpStation_" + key, field) || []
} // } else {
// res = await ctx.redis[methodType]("pumpStation_" + key) || []
// }
ctx.status = 200; ctx.status = 200;
ctx.body = JSON.parse(res) // ctx.body = JSON.parse(res)
ctx.body = []
} catch (error) { } catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400; ctx.status = 400;

Loading…
Cancel
Save