|
|
@ -238,6 +238,28 @@ async function del (ctx) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
async function cameraExport(ctx){ |
|
|
|
try { |
|
|
|
const { models } = ctx.fs.dc |
|
|
|
const { userId, token } = ctx.fs.api |
|
|
|
const { utils: { simpleExcelDown } } = ctx.app.fs |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// const filePath = await simpleExcelDown({ data: exportData, header, fileName: `NVR信息列表_${userId}_${moment().format('YYYYMMDDHHmmss')}` })
|
|
|
|
// const fileData = fs.readFileSync(filePath);
|
|
|
|
// let fileName = filePath.split('/').pop()
|
|
|
|
// ctx.status = 200;
|
|
|
|
// ctx.set('Content-Type', 'application/x-xls');
|
|
|
|
// ctx.set('Content-disposition', 'attachment; filename=' + encodeURI(fileName));
|
|
|
|
// ctx.body = fileData;
|
|
|
|
} catch (error) { |
|
|
|
ctx.fs.logger.error(`path: ${ctx.path}, error: ${error}`); |
|
|
|
ctx.status = 400; |
|
|
|
ctx.body = {} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
async function getAbility (ctx) { |
|
|
|
try { |
|
|
|
const { models } = ctx.fs.dc; |
|
|
@ -275,6 +297,7 @@ module.exports = { |
|
|
|
detail, |
|
|
|
banned, |
|
|
|
del, |
|
|
|
cameraExport, |
|
|
|
getAbility, |
|
|
|
getKind, |
|
|
|
}; |