Browse Source

萤石刷新

release_1.1.2
巴林闲侠 3 years ago
parent
commit
39b07a8733
  1. 1
      code/VideoAccess-VCMP/api/app/lib/controllers/status/push.js
  2. 6
      code/VideoAccess-VCMP/api/app/lib/schedule/freshYingshiMsg.js

1
code/VideoAccess-VCMP/api/app/lib/controllers/status/push.js

@ -11,7 +11,6 @@ async function edit (ctx) {
receiver, cameraId receiver, cameraId
} = ctx.request.body; } = ctx.request.body;
let configId_ = configId let configId_ = configId
let receiverSorted = receiver.sort() let receiverSorted = receiver.sort()
let cameraIdSorted = cameraId.sort() let cameraIdSorted = cameraId.sort()

6
code/VideoAccess-VCMP/api/app/lib/schedule/freshYingshiMsg.js

@ -47,6 +47,7 @@ module.exports = function (app, opts) {
name: d.deviceName, name: d.deviceName,
} }
if (existD) { if (existD) {
// 状态改变
if (existD.online != storageD.online) { if (existD.online != storageD.online) {
// 状态更新 // 状态更新
if (storageD.online == 'ON' && !existD.playUrl) { if (storageD.online == 'ON' && !existD.playUrl) {
@ -66,7 +67,7 @@ module.exports = function (app, opts) {
online: storageD.online, online: storageD.online,
ipctype: storageD.ipctype, ipctype: storageD.ipctype,
}) })
// 记录日志 // 记录在离线日志
const cameraRes = await models.Camera.findAll({ const cameraRes = await models.Camera.findAll({
where: { where: {
gbId: existD.id gbId: existD.id
@ -85,6 +86,9 @@ module.exports = function (app, opts) {
} }
} }
} else { } else {
// 播放地址更新
const playUrlRes = await getYingshiPlayUrl({ deviceSerial: d.deviceSerial, token: tokenYingshi })
storageD.playUrl = playUrlRes
const yingshiRes = await models.GbCamera.create(storageD) const yingshiRes = await models.GbCamera.create(storageD)
await models.Camera.update({ await models.Camera.update({
gbId: yingshiRes.id gbId: yingshiRes.id

Loading…
Cancel
Save