Commit db248d30 authored by 技术部-任文超's avatar 技术部-任文超

注销用户后,要接着清除缓存、解除微信关联

parent ac0bb31e
...@@ -920,6 +920,8 @@ public class InnerController implements IBaseController { ...@@ -920,6 +920,8 @@ public class InnerController implements IBaseController {
if (!user.getEnable()) { if (!user.getEnable()) {
sessionService.deleteByUserId(userId); sessionService.deleteByUserId(userId);
sessionService.deleteUserCatch(user); sessionService.deleteUserCatch(user);
// 禁用微信
wechatService.forbiddenUserWeChat(userId);
} }
return Objects.equals(enable, user.getEnable()); return Objects.equals(enable, user.getEnable());
} }
...@@ -1449,6 +1451,14 @@ public class InnerController implements IBaseController { ...@@ -1449,6 +1451,14 @@ public class InnerController implements IBaseController {
return JsonResult.buildErrorStateResult("用户手机号错误", null); return JsonResult.buildErrorStateResult("用户手机号错误", null);
} }
int affectedRows = userService.forbiddenUser(enable, phoneNo); int affectedRows = userService.forbiddenUser(enable, phoneNo);
// 清除缓存,解除微信关联
User user = userService.findByPhoneInDb(phoneNo);
if (null != user && !user.getEnable()) {
sessionService.deleteByUserId(user.getId());
sessionService.deleteUserCatch(user);
// 禁用微信
wechatService.forbiddenUserWeChat(user.getId());
}
log.info("[forbiddenUserOrNot][禁用或激活用户]:理由:reason:{},手机号phoneNo:{},受影响的行数affectedRows:{}", reason, phoneNo, affectedRows); log.info("[forbiddenUserOrNot][禁用或激活用户]:理由:reason:{},手机号phoneNo:{},受影响的行数affectedRows:{}", reason, phoneNo, affectedRows);
return JsonResult.buildSuccessResult("用户禁用或重启成功成功", affectedRows); return JsonResult.buildSuccessResult("用户禁用或重启成功成功", affectedRows);
} }
......
...@@ -34,9 +34,9 @@ public class TestJdk8 { ...@@ -34,9 +34,9 @@ public class TestJdk8 {
@Test @Test
public void wechatContent() { public void wechatContent() {
String userId = String.valueOf(20598404); String userId = String.valueOf(50963791);
String content = AESUtil.encryptAndBase64Encode(userId, Constants.AES_KEY); String content = AESUtil.encryptAndBase64Encode(userId, Constants.AES_KEY);
log.info("20598404:{}", content); log.info("50963791:{}", content);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment