Browse Source

fix 路由冲突

dev
CODE 1 year ago
parent
commit
3606b82610
  1. 5
      api/app/lib/controllers/project/group.js
  2. 4
      api/app/lib/routes/project/index.js
  3. 2
      web/client/src/utils/webapi.js

5
api/app/lib/controllers/project/group.js

@ -37,7 +37,7 @@ async function groupDetail (ctx) {
ctx.status = 200;
ctx.body = res
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: error`);
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
@ -126,7 +126,6 @@ async function delGroup (ctx) {
}
async function groupStatistic (ctx) {
console.log('ssssssaqqq',ctx.app.camunda)
try {
const { models } = ctx.fs.dc;
const { userId } = ctx.fs.api
@ -241,7 +240,7 @@ async function groupStatistic (ctx) {
strucCount += strucIdArr_.length
//所有结构物的告警
const ss = alarmRes.filter(p => strucIdArr_.some(q => q.strucId == p.StructureId))
todayAlarms= ss.reduce((p, c) => {
todayAlarms = ss.reduce((p, c) => {
return p + c.alarmCount
}, 0)
//

4
api/app/lib/routes/project/index.js

@ -34,8 +34,8 @@ module.exports = function (app, router, opts) {
app.fs.api.logAttr['GET/project/group'] = { content: '获取项目分组', visible: true };
router.get('/project/group', projectGroup.groupList);
app.fs.api.logAttr['GET/project/group/:groupId'] = { content: '获取项目分组详情', visible: true };
router.get('/project/group/:groupId', projectGroup.groupDetail);
app.fs.api.logAttr['GET/project/group/:groupId/detail'] = { content: '获取项目分组详情', visible: true };
router.get('/project/group/:groupId/detail', projectGroup.groupDetail);
app.fs.api.logAttr['PUT/project/group'] = { content: '编辑项目分组', visible: true };
router.put('/project/group', projectGroup.editGroup);

2
web/client/src/utils/webapi.js

@ -42,7 +42,7 @@ export const ApiTable = {
groupStatisticOnline: 'project/group/statistic/online',
groupStatisticAlarm: 'project/group/statistic/alarm',
groupProject: "project/group/list",
groupProjectDetail: "project/group/:groupId",
groupProjectDetail: "project/group/:groupId/detail",
//告警
getProjectPoms: 'project/poms', //获取已绑定项目

Loading…
Cancel
Save