bug fix 禁用用户后仍可登录

This commit is contained in:
shiziyuan9527 2020-05-27 14:42:54 +08:00
parent ab23a3d5f3
commit eeb6dd0a70
3 changed files with 6 additions and 5 deletions

View File

@ -69,6 +69,11 @@ public class UserController {
userService.updateUserRole(user);
}
@PostMapping("/special/update_status")
public void updateStatus(@RequestBody User user) {
userService.updateUser(user);
}
@PostMapping("/special/ws/member/list/{goPage}/{pageSize}")
@RequiresRoles(RoleConstants.ADMIN)
public Pager<List<User>> getMemberListByAdmin(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryMemberRequest request) {

View File

@ -241,8 +241,6 @@ public class UserService {
userRoleExample.createCriteria().andUserIdEqualTo(userId).andSourceIdEqualTo(request.getWorkspaceId());
List<UserRole> userRoles = userRoleMapper.selectByExample(userRoleExample);
if (userRoles.size() > 0) {
User user = userMapper.selectByPrimaryKey(userId);
String username = user.getName();
MSException.throwException(Translator.get("user_already_exists"));
} else {
for (String roleId : request.getRoleIds()) {
@ -274,8 +272,6 @@ public class UserService {
userRoleExample.createCriteria().andUserIdEqualTo(userId).andSourceIdEqualTo(request.getOrganizationId());
List<UserRole> userRoles = userRoleMapper.selectByExample(userRoleExample);
if (userRoles.size() > 0) {
User user = userMapper.selectByPrimaryKey(userId);
String username = user.getName();
MSException.throwException(Translator.get("user_already_exists"));
} else {
for (String roleId : request.getRoleIds()) {

View File

@ -489,7 +489,7 @@
this.btnAddRole = false;
},
changeSwitch(row) {
this.$post(this.updatePath, row, () => {
this.$post('/user/special/update_status', row, () => {
this.$success(this.$t('commons.modify_success'));
})
},