Browse Source

cameraOnlinePush

release_1.1.2
巴林闲侠 3 years ago
parent
commit
0ef8bd183a
  1. 8
      code/VideoAccess-VCMP/api/app/lib/schedule/cameraStatePush.js
  2. 3
      code/VideoAccess-VCMP/api/app/lib/schedule/freshYingshiMsg.js
  3. 4
      code/VideoAccess-VCMP/api/config.js

8
code/VideoAccess-VCMP/api/app/lib/schedule/cameraStatePush.js

@ -4,9 +4,10 @@ module.exports = function (app, opts) {
const cameraOnlinePush = app.fs.scheduleInit( const cameraOnlinePush = app.fs.scheduleInit(
{ {
interval: '* */15 * * * *', interval: '* */15 * * * *',
interval: '*/15 * * * * *', // interval: '* */1 * * * *',
// interval: '* */5 * * * *',
immediate: false, immediate: false,
proRun: true, // proRun: true,
}, },
async () => { async () => {
try { try {
@ -119,11 +120,12 @@ module.exports = function (app, opts) {
// camera: cameraIds, // camera: cameraIds,
} }
// 离线推送 // 离线推送
console.log('object');
if (offArr.length && c.noticeWay && c.noticeWay.includes('offline')) { if (offArr.length && c.noticeWay && c.noticeWay.includes('offline')) {
if (c.pushWay == 'email') { if (c.pushWay == 'email') {
// 邮件 // 邮件
let text = `${corUser[0].username}】账号下的设备,截止【${moment(timeNow).format('MM月DD日 HH时mm分')}】,有${offArr.length}个设备掉线:\n` let text = `${corUser[0].username}】账号下的设备,截止【${moment(timeNow).format('MM月DD日 HH时mm分')}】,有${offArr.length}个设备掉线:\n`
text += offArr.map(o => `${o.name}】于【${o.time}】掉线,`).join('\n') text += offArr.map(o => `${o.name}】于【${moment(o.time).format('MM月DD日 HH时mm分')}】掉线,`).join('\n')
text += `\n请及时处理!` text += `\n请及时处理!`
await pushByEmail({ await pushByEmail({
email: receiver, email: receiver,

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

@ -7,6 +7,7 @@ module.exports = function (app, opts) {
interval: '* */5 * * * *', interval: '* */5 * * * *',
// interval: '*/10 * * * *', // interval: '*/10 * * * *',
immediate: false, immediate: false,
// immediate: true,
proRun: true, proRun: true,
}, },
async () => { async () => {
@ -43,7 +44,7 @@ module.exports = function (app, opts) {
level: 0, level: 0,
ipctype: 'yingshi', ipctype: 'yingshi',
streamid: d.deviceSerial, streamid: d.deviceSerial,
online: d.status ? 'ON' : 'OFF', online: d.status == 1 ? 'ON' : 'OFF',
name: d.deviceName, name: d.deviceName,
} }
if (existD) { if (existD) {

4
code/VideoAccess-VCMP/api/config.js

@ -120,8 +120,8 @@ const product = {
port: 465, port: 465,
sender: { sender: {
name: '尚视', name: '尚视',
address: 'no-reply@zhiwucloud.com', address: 'fsiot@free-sun.com.cn',
password: 'Zwy123456_' password: 'Fs2689'
} }
}, },
pssaRequest: [ pssaRequest: [

Loading…
Cancel
Save