'use strict'; const Controller = require('../extend/baseController'); class SysRoleController extends Controller { tag() { return this.ctx.service.sysRoleService; } async listForPageWithNameR() { const { ctx } = this; ctx.setRegexMongoSql('queryName', 'name'); const result = await this.tag().listForPage(ctx.query); ctx.success(result); } async deleteWithSub() { const { ctx } = this; const query = ctx.query; const { id } = query; const result = await this.tag().deleteWithSub(id); ctx.logic(result, '删除失败,该角色存在用户'); } } module.exports = SysRoleController;