wenlele 2 years ago
parent
commit
e846e83c64
  1. 6
      api/app/lib/controllers/alarm/app.js
  2. 2
      api/app/lib/controllers/alarm/video.js

6
api/app/lib/controllers/alarm/app.js

@ -133,7 +133,7 @@ async function notedInspection (ctx) {
async function apiError (ctx) { async function apiError (ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { projectAppId, alarmContent, router, statusCode, screenshot = '', type } = ctx.request.body const { projectAppId, alarmContent, router, statusCode = null, screenshot = '', type } = ctx.request.body
const now = moment().format() const now = moment().format()
if (!type) { if (!type) {
@ -254,6 +254,10 @@ async function apiErrorList (ctx) {
'$app->projectCorrelations.pep_project_id$': { '$app->projectCorrelations.pep_project_id$': {
$in: projectRes.map(p => p.id) $in: projectRes.map(p => p.id)
}, },
}
)
findOption.where.$or.push(
{
'$app.name$': { $like: `%${keyword}%` } '$app.name$': { $like: `%${keyword}%` }
} }
) )

2
api/app/lib/controllers/alarm/video.js

@ -294,7 +294,7 @@ async function vcmpAppAuthToken (ctx) {
ctx.status = 200; ctx.status = 200;
ctx.body = { token } ctx.body = { token }
} 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;
ctx.body = { ctx.body = {
message: typeof error == 'string' ? error : undefined message: typeof error == 'string' ? error : undefined

Loading…
Cancel
Save