logs.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. 'use strict';
  2. const Controller = require('egg').Controller;
  3. class LogsController extends Controller {
  4. async listNormal(){
  5. let {ctx, service} = this;
  6. let data = ctx.request.query;
  7. let ret = await service.logs.adminListLogs(data);
  8. ctx.adminOK( ret );
  9. }
  10. async listFlyPosture() {
  11. let {ctx, service} = this;
  12. let data = ctx.request.query;
  13. let ret = await service.logs.adminListFlyPosture(data);
  14. ctx.adminOK( ret );
  15. }
  16. async listMessage() {
  17. let {ctx, service} = this;
  18. let data = ctx.request.query;
  19. let ret = await service.logs.adminListMessage(data);
  20. ctx.adminOK( ret );
  21. }
  22. async exportXls(){
  23. const {ctx, service} = this;
  24. ctx.set("Content-Type", "application/vnd.openxmlformats");
  25. ctx.set("Content-Disposition","attachment;filename*=UTF-8 xx.xlsx");
  26. let ret = await service.logs.exportXls( ctx.request.query );
  27. ctx.body = ret;
  28. }
  29. }
  30. module.exports = LogsController;