perm.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. 'use strict';
  2. const Controller = require('egg').Controller;
  3. class PermsController extends Controller {
  4. async add() {
  5. let {service, ctx } = this;
  6. await ctx.bodyHandleByService(service.sysPerm, "addPerm", "添加成功");
  7. }
  8. async list() {
  9. let {service, ctx } = this;
  10. await ctx.queryHandleByService(service.sysPerm, "listPerm");
  11. }
  12. async delete() {
  13. let {service, ctx } = this;
  14. await ctx.queryHandleByService(service.sysPerm, "deletePerm","删除成功!");
  15. }
  16. async edit() {
  17. let {service, ctx } = this;
  18. await ctx.bodyHandleByService(service.sysPerm, "editPerm","更新成功!");
  19. }
  20. async deleteBatch() {
  21. let {service, ctx } = this;
  22. await ctx.queryHandleByService(service.sysPerm, "deleteBatch","删除成功!");
  23. }
  24. async getUserPermissionByToken() {
  25. let {service, ctx } = this;
  26. await ctx.queryHandleByService(service.sysPerm, "getUserPermissionByToken");
  27. }
  28. async queryallrole() {
  29. let {service, ctx } = this;
  30. await ctx.queryHandleByService(service.sysPerm, "queryallrole");
  31. }
  32. }
  33. module.exports = PermsController;