diff --git a/LearningOfficer.OA.Services/LoginMobile/LoginMobilAppService.cs b/LearningOfficer.OA.Services/LoginMobile/LoginMobilAppService.cs index 05f8c8e..1fe94de 100644 --- a/LearningOfficer.OA.Services/LoginMobile/LoginMobilAppService.cs +++ b/LearningOfficer.OA.Services/LoginMobile/LoginMobilAppService.cs @@ -128,6 +128,17 @@ namespace LearningOfficer.OA.Services.LoginMobile { throw new BusinessException("账号或密码错误"); } + var per = await _db.Queryable() + .Where(s => s.UserId == userResult.Id) + .FirstAsync(); + if (per == null) + { + throw new BusinessException("用户权限配置错误,请联系管理员"); + } + if (per.RoleEnum != SysRoleEnum.TeamLeader && per.RoleEnum != SysRoleEnum.LearningOfficer) + { + throw new BusinessException("只有组长/学习官可以登录"); + } userResult.UserType = 1; return userResult; }