Browse Source

获取巡检记录排除 rslt 中为 null 的记录

master
巴林闲侠 2 years ago
parent
commit
81bd334202
  1. 3
      api/app/lib/controllers/patrolManage/patrolRecord.js

3
api/app/lib/controllers/patrolManage/patrolRecord.js

@ -119,6 +119,7 @@ async function findPatrolRecord (ctx, next) {
} }
} }
let userInfo = ctx.fs.api.userInfo; let userInfo = ctx.fs.api.userInfo;
rslt = rslt.filter(f => f)
if (userInfo.username != 'SuperAdmin') { if (userInfo.username != 'SuperAdmin') {
if (userInfo.structure) { if (userInfo.structure) {
rslt = rslt.filter(s => userInfo.structure.find(x => x == s.points.project.id)) rslt = rslt.filter(s => userInfo.structure.find(x => x == s.points.project.id))
@ -204,7 +205,7 @@ async function addPatrolRecord (ctx, next) {
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": '新增巡检计划失败' "message": '新增巡检记录失败'
} }
} }
} }

Loading…
Cancel
Save