bug fix 禁用用户后仍可登录
This commit is contained in:
parent
ab23a3d5f3
commit
eeb6dd0a70
|
@ -69,6 +69,11 @@ public class UserController {
|
||||||
userService.updateUserRole(user);
|
userService.updateUserRole(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/special/update_status")
|
||||||
|
public void updateStatus(@RequestBody User user) {
|
||||||
|
userService.updateUser(user);
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/special/ws/member/list/{goPage}/{pageSize}")
|
@PostMapping("/special/ws/member/list/{goPage}/{pageSize}")
|
||||||
@RequiresRoles(RoleConstants.ADMIN)
|
@RequiresRoles(RoleConstants.ADMIN)
|
||||||
public Pager<List<User>> getMemberListByAdmin(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryMemberRequest request) {
|
public Pager<List<User>> getMemberListByAdmin(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryMemberRequest request) {
|
||||||
|
|
|
@ -241,8 +241,6 @@ public class UserService {
|
||||||
userRoleExample.createCriteria().andUserIdEqualTo(userId).andSourceIdEqualTo(request.getWorkspaceId());
|
userRoleExample.createCriteria().andUserIdEqualTo(userId).andSourceIdEqualTo(request.getWorkspaceId());
|
||||||
List<UserRole> userRoles = userRoleMapper.selectByExample(userRoleExample);
|
List<UserRole> userRoles = userRoleMapper.selectByExample(userRoleExample);
|
||||||
if (userRoles.size() > 0) {
|
if (userRoles.size() > 0) {
|
||||||
User user = userMapper.selectByPrimaryKey(userId);
|
|
||||||
String username = user.getName();
|
|
||||||
MSException.throwException(Translator.get("user_already_exists"));
|
MSException.throwException(Translator.get("user_already_exists"));
|
||||||
} else {
|
} else {
|
||||||
for (String roleId : request.getRoleIds()) {
|
for (String roleId : request.getRoleIds()) {
|
||||||
|
@ -274,8 +272,6 @@ public class UserService {
|
||||||
userRoleExample.createCriteria().andUserIdEqualTo(userId).andSourceIdEqualTo(request.getOrganizationId());
|
userRoleExample.createCriteria().andUserIdEqualTo(userId).andSourceIdEqualTo(request.getOrganizationId());
|
||||||
List<UserRole> userRoles = userRoleMapper.selectByExample(userRoleExample);
|
List<UserRole> userRoles = userRoleMapper.selectByExample(userRoleExample);
|
||||||
if (userRoles.size() > 0) {
|
if (userRoles.size() > 0) {
|
||||||
User user = userMapper.selectByPrimaryKey(userId);
|
|
||||||
String username = user.getName();
|
|
||||||
MSException.throwException(Translator.get("user_already_exists"));
|
MSException.throwException(Translator.get("user_already_exists"));
|
||||||
} else {
|
} else {
|
||||||
for (String roleId : request.getRoleIds()) {
|
for (String roleId : request.getRoleIds()) {
|
||||||
|
|
|
@ -489,7 +489,7 @@
|
||||||
this.btnAddRole = false;
|
this.btnAddRole = false;
|
||||||
},
|
},
|
||||||
changeSwitch(row) {
|
changeSwitch(row) {
|
||||||
this.$post(this.updatePath, row, () => {
|
this.$post('/user/special/update_status', row, () => {
|
||||||
this.$success(this.$t('commons.modify_success'));
|
this.$success(this.$t('commons.modify_success'));
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue