123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- 'use strict';
- const Controller = require('egg').Controller;
- class SysUserController extends Controller {
- async list() {
- const {ctx, service} = this;
- let query = ctx.request.query;
- let ret = await service.sysUser.list(query);
- ctx.adminOK(ret);
- }
- async roleList() {
- const {ctx, service} = this;
- let query = ctx.request.query;
- let ret = await service.sysUser.roleList(query);
- ctx.adminOK(ret);
- }
- async userRoleList() {
- const {ctx, service} = this;
- let query = ctx.request.query;
- let ret = await service.sysUser.userRoleList(query);
- ctx.adminOK(ret);
- }
- async delete() {
- const {ctx, service} = this;
- let id = ctx.request.query.id;
- let ret = await service.sysUser.delete(id);
- ctx.adminOK(ret, "删除成功");
- }
- async deleteRole() {
- const {ctx, service} = this;
- let id = ctx.request.query.id;
- let ret = await service.sysUser.deleteRole(id);
- ctx.adminOK(ret, "删除成功");
- }
-
- async deleteUserRole() {
- const {ctx, service} = this;
- let data = ctx.request.query;
- let ret = await service.sysUser.deleteUserRole(data);
- ctx.adminOK(ret, "删除成功");
- }
- async deleteUserRoleBatch ()
- {
- const {ctx, service} = this;
- let data = ctx.request.query;
- let ret = await service.sysUser.deleteUserRoleBatch(data);
- ctx.adminOK(ret, "删除成功");
- }
- async edit() {
- const {ctx, service} = this;
- let data = ctx.request.body;
- let ret = await service.sysUser.edit( data );
- ctx.adminOK(ret, "更新成功");
- }
- async editRole() {
- const {ctx, service} = this;
- let data = ctx.request.body;
- let ret = await service.sysUser.editRole( data );
- ctx.adminOK(ret, "更新成功");
- }
- async add() {
- const {ctx, service} = this;
- let data = ctx.request.body;
- let ret = await service.sysUser.add( data );
- ctx.adminOK(ret, "添加成功");
- }
- async addRole() {
- const {ctx, service} = this;
- let data = ctx.request.body;
- let ret = await service.sysUser.addRole( data );
- ctx.adminOK(ret, "添加成功");
- }
- async addSysUserRole() {
- const {ctx, service} = this;
- let data = ctx.request.body;
- let ret = await service.sysUser.addSysUserRole( data );
- ctx.adminOK(ret, "添加成功");
- }
- async resetpwd() {
- const {ctx, service} = this;
- let data = ctx.request.body;
- let ret = await service.sysUser.resetpwd( data );
- ctx.adminOK(ret, "重置成功");
- }
- async frozenBatch() {
- const {ctx, service} = this;
- let data = ctx.request.body;
- let ret = await service.sysUser.frozenBatch( data );
- ctx.adminOK(ret, "冻结成功");
- }
- async queryUserRole() {
- const {ctx, service} = this;
- let data = ctx.request.query;
- let ret = await service.sysUser.queryUserRole( data );
- ctx.adminOK(ret);
- }
- async checkOnlyUser() {
- const {ctx, service} = this;
- let data = ctx.request.query;
- let ret = await service.sysUser.checkOnlyUser( data );
- ctx.adminOK(ret);
- }
- async queryTreeList() {
- const {ctx, service} = this;
- await ctx.queryHandleByService(service.sysUser, "queryTreeList");
- }
- async saveRolePermission()
- {
- //sys/permission/saveRolePermission
- const {ctx, service} = this;
- await ctx.bodyHandleByService(service.sysUser, "saveRolePermission", "保存成功");
- }
-
- async queryRolePermission() {
- const {ctx, service} = this;
- await ctx.queryHandleByService(service.sysUser, "queryRolePermission");
- }
- }
- module.exports = SysUserController;
|