diff --git a/code/VideoAccess-VCMP/api/app/lib/controllers/camera/create.js b/code/VideoAccess-VCMP/api/app/lib/controllers/camera/create.js
index 3af5b2e..cc74a2e 100644
--- a/code/VideoAccess-VCMP/api/app/lib/controllers/camera/create.js
+++ b/code/VideoAccess-VCMP/api/app/lib/controllers/camera/create.js
@@ -161,6 +161,7 @@ async function createNvrCamera (ctx) {
})
} else {
createData.push({
+ type: 'nvr',
serialNo: c.streamid,
name: c.name,
sip: corCamera.sipip,
diff --git a/code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js b/code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js
index 4efc107..f1a4370 100644
--- a/code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js
+++ b/code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js
@@ -221,23 +221,35 @@ async function banned (ctx) {
}
async function del (ctx) {
+ const transaction = await ctx.fs.dc.orm.transaction();
try {
const { models } = ctx.fs.dc;
- const { cameraId } = ctx.query
+ const { cameraId } = ctx.params
const { token } = ctx.fs.api
- await models.cameraId.destroy({
+ await models.CameraAbilityBind.destroy({
+ where: {
+ cameraId: cameraId
+ },
+ transaction
+ })
+
+ await models.Camera.destroy({
where: {
id: cameraId
- }
+ },
+ transaction
})
- if (cameraId.length) {
- await ctx.app.fs.axyRequest.delete('vcmp/camera/project', { query: { token, cameraId: cameraId.join(',') } })
+
+ if (cameraId) {
+ await ctx.app.fs.axyRequest.delete('vcmp/camera/project', { query: { token, cameraId: cameraId } })
}
+ await transaction.commit();
ctx.status = 204;
} catch (error) {
+ await transaction.rollback();
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`);
ctx.status = 400;
ctx.body = {}
diff --git a/code/VideoAccess-VCMP/api/app/lib/controllers/nvr/index.js b/code/VideoAccess-VCMP/api/app/lib/controllers/nvr/index.js
index 01d58a6..e96d72d 100644
--- a/code/VideoAccess-VCMP/api/app/lib/controllers/nvr/index.js
+++ b/code/VideoAccess-VCMP/api/app/lib/controllers/nvr/index.js
@@ -243,7 +243,20 @@ async function detail (ctx) {
}
const corUser = await ctx.app.fs.authRequest.get(`user/${nvrRes.createUserId}/message`, { query: { token } })
-
+ const serverDRes = (await ctx.app.fs.videoServerRequest.post(`gateway/plugins`) || '')
+ const serverDArr = JSON.parse(serverDRes.replace(/'/g, '"')) || []
+ const serverDConfig = serverDArr.find(s => s.Name == 'GB28181')
+ let serveD = {}
+ if (serverDConfig) {
+ const { Config } = serverDConfig
+ let ConfigArr = Config.split('\n')
+ for (let c of ConfigArr) {
+ let config = c.split(' = ')
+ if (config.length == 2) {
+ serveD[config[0].trim()] = config[1].trim().replace(/\"/g, '')
+ }
+ }
+ }
let nvrDetail = {
...nvrRes.dataValues,
station: bindStations,
@@ -251,7 +264,8 @@ async function detail (ctx) {
createUser: {
namePresent: corUser[0].namePresent
},
- accessWay: 'GB/T28181'
+ accessWay: 'GB/T28181',
+ accessInfo: serveD
}
ctx.status = 200;
diff --git a/code/VideoAccess-VCMP/api/app/lib/routes/camera/index.js b/code/VideoAccess-VCMP/api/app/lib/routes/camera/index.js
index 702be70..ba98441 100644
--- a/code/VideoAccess-VCMP/api/app/lib/routes/camera/index.js
+++ b/code/VideoAccess-VCMP/api/app/lib/routes/camera/index.js
@@ -35,8 +35,8 @@ module.exports = function (app, router, opts) {
app.fs.api.logAttr['PUT/camera/banned'] = { content: '禁用摄像头', visible: false };
router.put('/camera/banned', camera.banned);
- app.fs.api.logAttr['DEL/camera'] = { content: '删除摄像头', visible: false };
- router.delete('/camera', camera.del);
+ app.fs.api.logAttr['DEL/camera/:cameraId'] = { content: '删除摄像头', visible: false };
+ router.delete('/camera/:cameraId', camera.del);
app.fs.api.logAttr['GET/camera/export'] = { content: '导出摄像头信息', visible: false };
router.get('/camera/export', camera.cameraExport);
diff --git a/code/VideoAccess-VCMP/api/app/lib/service/paasRequest.js b/code/VideoAccess-VCMP/api/app/lib/service/paasRequest.js
index 5ab6678..1cfa081 100644
--- a/code/VideoAccess-VCMP/api/app/lib/service/paasRequest.js
+++ b/code/VideoAccess-VCMP/api/app/lib/service/paasRequest.js
@@ -2,9 +2,10 @@
const request = require('superagent')
class paasRequest {
- constructor(root, { query = {} } = {}) {
+ constructor(root, { query = {} } = {}, option) {
this.root = root;
this.query = query
+ this.option = option
}
#buildUrl = (url) => {
@@ -16,7 +17,7 @@ class paasRequest {
if (err) {
reject(err);
} else {
- resolve(res.body);
+ resolve(res[this.option.dataWord]);
}
};
}
@@ -51,7 +52,7 @@ function factory (app, opts) {
try {
for (let r of opts.pssaRequest) {
if (r.name && r.root) {
- app.fs[r.name] = new paasRequest(r.root, { ...(r.params || {}) })
+ app.fs[r.name] = new paasRequest(r.root, { ...(r.params || {}) }, { dataWord: r.dataWord || 'body' })
} else {
throw 'opts.pssaRequest 参数错误!'
}
diff --git a/code/VideoAccess-VCMP/web/client/src/components/simpleFileDownButton.jsx b/code/VideoAccess-VCMP/web/client/src/components/simpleFileDownButton.jsx
index 047594a..5ee4eee 100644
--- a/code/VideoAccess-VCMP/web/client/src/components/simpleFileDownButton.jsx
+++ b/code/VideoAccess-VCMP/web/client/src/components/simpleFileDownButton.jsx
@@ -23,7 +23,9 @@ const SimpleFileDownButton = (props) => {
>
导出
-
+ {
+ downloadUrl ? : ''
+ }
>
)
}
diff --git a/code/VideoAccess-VCMP/web/client/src/layout/components/header/index.jsx b/code/VideoAccess-VCMP/web/client/src/layout/components/header/index.jsx
index 684980d..5d8ee4d 100644
--- a/code/VideoAccess-VCMP/web/client/src/layout/components/header/index.jsx
+++ b/code/VideoAccess-VCMP/web/client/src/layout/components/header/index.jsx
@@ -4,82 +4,84 @@ import { connect } from "react-redux";
import { Nav, Avatar, Dropdown } from "@douyinfe/semi-ui";
const Header = (props) => {
- const { dispatch, history, user, actions, socket } = props;
+ const { dispatch, history, user, actions, socket } = props;
- return (
- <>
-