This commit is contained in:
parent
cdc4a78198
commit
8fb83a8b93
|
|
@ -24,20 +24,17 @@ namespace ZR.Admin.WebApi.Controllers.System
|
|||
private readonly ISysRoleService RoleService;
|
||||
private readonly ISysPostService PostService;
|
||||
private readonly ISysUserPostService UserPostService;
|
||||
private readonly ISqlSugarClient _db;
|
||||
|
||||
public SysUserController(
|
||||
ISysUserService userService,
|
||||
ISysRoleService roleService,
|
||||
ISysPostService postService,
|
||||
ISysUserPostService userPostService,
|
||||
ISqlSugarClient db)
|
||||
ISysUserPostService userPostService)
|
||||
{
|
||||
UserService = userService;
|
||||
RoleService = roleService;
|
||||
PostService = postService;
|
||||
UserPostService = userPostService;
|
||||
_db = db;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -100,7 +97,8 @@ namespace ZR.Admin.WebApi.Controllers.System
|
|||
if (!HttpContext.IsAdmin())
|
||||
{
|
||||
var currentDeptId = HttpContext.GetDeptId();
|
||||
var visibleDeptIds = DeptDataScopeHelper.GetVisibleDeptIds(_db, currentDeptId);
|
||||
var db = App.GetService<ISqlSugarClient>();
|
||||
var visibleDeptIds = DeptDataScopeHelper.GetVisibleDeptIds(db, currentDeptId);
|
||||
if (!visibleDeptIds.Contains(user.DeptId))
|
||||
{
|
||||
throw new CustomException("无权为该公司创建账号");
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user