|
@@ -762,7 +762,7 @@ public class TBUserController {
|
|
|
@Transactional
|
|
|
public Result userUpdatePwd(@ApiJsonObject(name = "userUpdatePwd", value = {
|
|
|
@ApiJsonProperty(key = "id", type = "long", example = "1", description = "用户ID"),
|
|
|
- @ApiJsonProperty(key = "password", description = "新密码")}) @ApiParam(value = "用户信息", required = true) @RequestBody Map<String, Object> mapParameter) {
|
|
|
+ @ApiJsonProperty(key = "password", description = "新密码")}) @ApiParam(value = "用户信息", required = true) @RequestBody Map<String, Object> mapParameter) throws NoSuchAlgorithmException {
|
|
|
if (Objects.isNull(mapParameter.get(SystemConstant.ID)) || Objects.equals(mapParameter.get(SystemConstant.ID), "")) {
|
|
|
throw new BusinessException(ExceptionResultEnum.USER_ID_IS_NULL);
|
|
|
}
|
|
@@ -779,7 +779,20 @@ public class TBUserController {
|
|
|
tbUser.setPassword(password);
|
|
|
tbUser.setUpdateId(currentUser.getId());
|
|
|
tbUserService.updateById(tbUser);
|
|
|
+
|
|
|
+ AuthDto authDto = cacheService.addAccountAuthCache(tbUser.getId());
|
|
|
+ if (Objects.nonNull(authDto)) {
|
|
|
+ for (Source s : Source.values()) {
|
|
|
+ String sessionId = SessionUtil
|
|
|
+ .digest(tbUser.getId(), Math.abs(authDto.getRoleCodes().toString().hashCode()), s.name());
|
|
|
+ if (Objects.nonNull(redisUtil.getUserSession(sessionId))) {
|
|
|
+ redisUtil.deleteUserSession(sessionId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
cacheService.removeAccountCache(tbUser.getId());
|
|
|
+ cacheService.removeAccountAuthCache(tbUser.getId());
|
|
|
return ResultUtil.ok(true);
|
|
|
}
|
|
|
}
|