This commit is contained in:
PQZ 2024-08-28 15:24:25 +08:00
parent bac3c3f6b3
commit 59e049c2ef

View File

@ -104,11 +104,11 @@ public class AuthController {
} }
List<RoleReqDTO> roleList = roleApi.getRoleList(); List<RoleReqDTO> roleList = roleApi.getRoleList();
List<String> roleNames = roleList.stream().filter(item -> roleIdsByUserId.contains(item.getId())).map(item -> item.getName()).collect(Collectors.toList()); List<String> roleNames = roleList.stream().filter(item -> roleIdsByUserId.contains(item.getId())).map(item -> item.getName()).collect(Collectors.toList());
Boolean flag = (loginBody.getType().equals("0") && roleNames.contains("救援业务管理员")) || (loginBody.getType().equals("1") && roleNames.contains("交警")); // Boolean flag = (loginBody.getType().equals("0") && roleNames.contains("救援业务管理员")) || (loginBody.getType().equals("1") && roleNames.contains("交警"));
// 角色认证登录 // 角色认证登录
if (!flag) { // if (!flag) {
return error(new ErrorCode(2_002_000_005, "登录账号不存在")); // return error(new ErrorCode(2_002_000_005, "登录账号不存在"));
} // }
AuthLoginReqVO authLoginReqVO = new AuthLoginReqVO(); AuthLoginReqVO authLoginReqVO = new AuthLoginReqVO();
authLoginReqVO.setUsername(loginBody.getUsername()); authLoginReqVO.setUsername(loginBody.getUsername());
authLoginReqVO.setPassword(loginBody.getPassword()); authLoginReqVO.setPassword(loginBody.getPassword());