Browse Source

fix 5810 普通成员登录后查看应用异常数据范围未做限制

dev
巴林闲侠 2 years ago
parent
commit
7347abab7e
  1. 15
      api/app/lib/controllers/alarm/app.js

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

@ -35,8 +35,17 @@ async function inspectionList (ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { clickHouse } = ctx.app.fs const { clickHouse } = ctx.app.fs
const { utils: { anxinStrucIdRange, pomsProjectRange } } = ctx.app.fs
const { timeStart, timeEnd, projectId, appId, noted } = ctx.query const { timeStart, timeEnd, projectId, appId, noted } = ctx.query
let pomsProjectIds = null
if (!projectId && !appId) {
let pomsProject = await pomsProjectRange({
ctx,
})
pomsProjectIds = pomsProject.map(p => p.id)
}
let findOption = { let findOption = {
where: { where: {
@ -58,8 +67,10 @@ async function inspectionList (ctx) {
projectId ? projectId ?
{ {
id: projectId id: projectId
} : } : {},
{} pomsProjectIds ? {
id: { $in: pomsProjectIds }
} : {}
), ),
attributes: { attributes: {
exclude: ['anxinProjectId', 'createTime', 'createUser'] exclude: ['anxinProjectId', 'createTime', 'createUser']

Loading…
Cancel
Save