1234567891011121314151617181920 |
- 'use strict';
- const Service = require('../service/baseService');
- class SysRoleService extends Service {
- tag() {
- return this.ctx.model.SysRoleModel;
- }
- async deleteWithSub(id) {
- const { model } = this.ctx;
- const dbUserArr = await model.SysUserModel.find({ role: id });
- if (dbUserArr.length > 0) {
- return null;
- }
- return await this.delete(id);
- }
- }
- module.exports = SysRoleService;
|