|
@ -12,7 +12,7 @@ async function getCameraProject (ctx, next) { |
|
|
let findOption = { |
|
|
let findOption = { |
|
|
attributes: { exclude: ['delete', 'recycleTime',] }, |
|
|
attributes: { exclude: ['delete', 'recycleTime',] }, |
|
|
where: { |
|
|
where: { |
|
|
// createUserId: userId,
|
|
|
createUserId: userId, |
|
|
recycleTime: null, |
|
|
recycleTime: null, |
|
|
delete: false |
|
|
delete: false |
|
|
}, |
|
|
}, |
|
@ -262,11 +262,13 @@ async function detail (ctx) { |
|
|
async function getCameraListAll (ctx) { |
|
|
async function getCameraListAll (ctx) { |
|
|
try { |
|
|
try { |
|
|
const { models } = ctx.fs.dc; |
|
|
const { models } = ctx.fs.dc; |
|
|
var front = new moment(); //验证前时间
|
|
|
const { userId, token } = ctx.fs.api |
|
|
|
|
|
|
|
|
const cameraRes = await models.Camera.findAll({ |
|
|
const cameraRes = await models.Camera.findAll({ |
|
|
attributes: { exclude: ['delete', 'recycleTime', 'rtmp', 'createUserId', 'nvrId', 'kindId', 'yingshiSecretId', 'gbId'] }, |
|
|
attributes: { exclude: ['delete', 'recycleTime', 'rtmp', 'createUserId', 'nvrId', 'kindId', 'yingshiSecretId', 'gbId'] }, |
|
|
order: [['id', 'DESC']], |
|
|
order: [['id', 'DESC']], |
|
|
where: { |
|
|
where: { |
|
|
|
|
|
createUserId: userId, |
|
|
delete: false, |
|
|
delete: false, |
|
|
recycleTime: null, |
|
|
recycleTime: null, |
|
|
}, |
|
|
}, |
|
@ -286,9 +288,7 @@ async function getCameraListAll (ctx) { |
|
|
], |
|
|
], |
|
|
}] |
|
|
}] |
|
|
}) |
|
|
}) |
|
|
var after = new moment(); |
|
|
|
|
|
var duration = moment.duration(after.diff(front))._data.milliseconds; |
|
|
|
|
|
console.log('duration',duration) |
|
|
|
|
|
ctx.status = 200; |
|
|
ctx.status = 200; |
|
|
ctx.body = cameraRes |
|
|
ctx.body = cameraRes |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|