Commit 4288e93d authored by 李丛阳's avatar 李丛阳

authen

parent 1d7cd3dd
......@@ -100,14 +100,13 @@ public class AuthenticationServiceImpl implements AuthenticationService {
rolePeration = sysRoleRepository.queryRoleByRoleCode("10",role.get(0).getBusinessId());
//如果用户请求登录后台,并且但是其并没有任何后台权限,抛出异常
if (userType.equals("1")&&rolePeration == 0){
if (userType.equals("1")&&rolePeration == 0)
throw new ServiceException(ResultServiceEnums.ROLE_ERROR);
}else if(userType.equals("0")&&global.getAdminCode().equals(role.get(0).getCode())){//代表请求前台,教师和学生可以请求,管理员不可以
else if(userType.equals("0")&&global.getAdminCode().equals(role.get(0).getCode()))
//代表请求前台,教师和学生可以请求,管理员不可以
throw new ServiceException(ResultServiceEnums.ROLE_ERROR);
}
}else{
}else
throw new ServiceException(ResultServiceEnums.ROLE_ERROR);
}
//查询菜单权限
List<MenuDto> menus = sysMenuRepository.queryMeunsByRoleId(role.get(0).getBusinessId());
......@@ -116,11 +115,10 @@ public class AuthenticationServiceImpl implements AuthenticationService {
String agencyCode = "";
//请求登陆运维平台并且拥有登录运维平台权限并且不是Admin的用户,查询他的所属教学单位
if (userType.equals("1")&&rolePeration==1&&!global.getAdminCode().equals(role.get(0).getCode())){
if (userType.equals("1")&&rolePeration!=0&&!global.getAdminCode().equals(role.get(0).getCode())){
//查询教学单位code
agencyCode = bCompanyRepository.queryAgencyCodeByCode(username);
}
userAuthDTO.setUserId(sysUser.getBusinessId());
userAuthDTO.setName(sysUser.getName());
userAuthDTO.setHeadPic(sysUser.getHeadPic());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment