|
|
@@ -458,6 +458,14 @@ public class LoginController {
|
|
|
redisUtils.delete ( CacheNames.USER_CACHE_TOKEN, userDTO.getToken() );
|
|
|
redisUtils.delete ( CacheNames.USER_CACHE_ONLINE_USERS, userDTO.getToken() );
|
|
|
}
|
|
|
+ //清除钉钉绑定id
|
|
|
+ if(StringUtils.isNotBlank(currentUserDTO.getDdId()) && StringUtils.isNotBlank(currentUserDTO.getId())){
|
|
|
+ UserDTO bindUserDTO = new UserDTO();
|
|
|
+ bindUserDTO.setId(currentUserDTO.getId());
|
|
|
+ bindUserDTO.setDdId("");
|
|
|
+ userApi.updateUserById(bindUserDTO);
|
|
|
+ }
|
|
|
+
|
|
|
return ResponseEntity.ok ( "退出成功" );
|
|
|
}
|
|
|
|
|
|
@@ -618,16 +626,16 @@ public class LoginController {
|
|
|
|
|
|
UserDTO userDTO = userApi.getByLoginName(username, tenantId);
|
|
|
|
|
|
- if ("妯婅帀".equals(userDTO.getName())) {
|
|
|
+ if("樊莉".equals(userDTO.getName())){
|
|
|
|
|
|
- List<UserDTO> onLineUserList = SpringUtil.getBean(IUserApi.class).getOnLineUserList("榛勭幃", "10002");
|
|
|
- if (!onLineUserList.isEmpty()) {
|
|
|
- throw new DisabledException("褰撳墠榛勭幃宸茬櫥褰曠郴缁燂紝" + ErrorConstants.LOGIN_ERROR);
|
|
|
+ List<UserDTO> onLineUserList = SpringUtil.getBean(IUserApi.class).getOnLineUserList("黄玮", "10002");
|
|
|
+ if(!onLineUserList.isEmpty()){
|
|
|
+ throw new DisabledException ( "当前黄玮已登录系统," + ErrorConstants.LOGIN_ERROR );
|
|
|
}
|
|
|
- } else if ("榛勭幃".equals(userDTO.getName())) {
|
|
|
- List<UserDTO> onLineUserList = SpringUtil.getBean(IUserApi.class).getOnLineUserList("妯婅帀", "10002");
|
|
|
- if (!onLineUserList.isEmpty()) {
|
|
|
- throw new DisabledException("褰撳墠妯婅帀宸茬櫥褰曠郴缁燂紝" + ErrorConstants.LOGIN_ERROR);
|
|
|
+ }else if("黄玮".equals(userDTO.getName())){
|
|
|
+ List<UserDTO> onLineUserList = SpringUtil.getBean(IUserApi.class).getOnLineUserList("樊莉", "10002");
|
|
|
+ if(!onLineUserList.isEmpty()){
|
|
|
+ throw new DisabledException ( "当前樊莉已登录系统," + ErrorConstants.LOGIN_ERROR );
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -662,9 +670,10 @@ public class LoginController {
|
|
|
if (CommonConstants.NO.equals(userDTO.getLoginFlag())) {
|
|
|
throw new LockedException(ErrorConstants.LOGIN_ERROR_FORBIDDEN);
|
|
|
}
|
|
|
- if (StringUtils.isNotBlank(userDTO.getDdId()) && !bindInfo.getDdId().equals(userDTO.getDdId())) {
|
|
|
- return ResponseEntity.badRequest().body("Current system account is already bound to another DingTalk account");
|
|
|
- }
|
|
|
+ //此处用作钉钉绑定唯一系统账号的拦截
|
|
|
+ //if (StringUtils.isNotBlank(userDTO.getDdId()) && !bindInfo.getDdId().equals(userDTO.getDdId())) {
|
|
|
+ // return ResponseEntity.badRequest().body("Current system account is already bound to another DingTalk account");
|
|
|
+ //}
|
|
|
UserDTO bindUserDTO = new UserDTO();
|
|
|
bindUserDTO.setId(userDTO.getId());
|
|
|
bindUserDTO.setDdId(bindInfo.getDdId());
|