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) {
try {
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) || []
}
console.log(ctx);
// 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) || []
// }
ctx.status = 200;
ctx.body = JSON.parse(res)
// ctx.body = JSON.parse(res)
ctx.body = []
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;

Loading…
Cancel
Save