|
@ -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 |
|
|