From da7cd8a9bbb77fe20003e2ba2c0e13efc8b89ac8 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Wed, 30 Nov 2022 11:19:39 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E6=8E=A8=E9=80=81debug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/auth/index.js | 14 ++++++++++++++ api/app/lib/schedule/alarms_push.js | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/api/app/lib/controllers/auth/index.js b/api/app/lib/controllers/auth/index.js index 555caf8..8055d5c 100644 --- a/api/app/lib/controllers/auth/index.js +++ b/api/app/lib/controllers/auth/index.js @@ -93,6 +93,20 @@ async function login (ctx, next) { } } +async function complement (ctx) { + try { + const { models } = ctx.fs.dc; + + ctx.status = 20; + } catch (error) { + ctx.fs.logger.error(`path: ${ctx.path}, error: error`); + ctx.status = 400; + ctx.body = { + message: typeof error == 'string' ? error : undefined + } + } +} + async function logout (ctx) { try { const models = ctx.fs.dc.models; diff --git a/api/app/lib/schedule/alarms_push.js b/api/app/lib/schedule/alarms_push.js index 320042c..c98f033 100644 --- a/api/app/lib/schedule/alarms_push.js +++ b/api/app/lib/schedule/alarms_push.js @@ -683,7 +683,7 @@ module.exports = function (app, opts) { SELECT * FROM alarm_details WHERE AlarmId IN (${dataAlarms.map(da => da.AlarmId).join(',')}, '-1') AND AlarmState = 0 - `) + `).toPromise() } if (proDebug) { console.log(`查得数据告警详情数据 ${dataAlarmDetails.length} 条`);