From 1ff35f0c361b60529f0b39a7f4539bd6b23a5bb0 Mon Sep 17 00:00:00 2001 From: hu177768073 <177768073@qq.com> Date: Wed, 18 Sep 2024 14:37:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hfkj/service/user/impl/BsUserServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/service/src/main/java/com/hfkj/service/user/impl/BsUserServiceImpl.java b/service/src/main/java/com/hfkj/service/user/impl/BsUserServiceImpl.java index 7f26b1a..f500249 100644 --- a/service/src/main/java/com/hfkj/service/user/impl/BsUserServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/user/impl/BsUserServiceImpl.java @@ -89,6 +89,7 @@ public class BsUserServiceImpl implements BsUserService { if (user == null) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "未找到用户"); } + String oldPhone = user.getPhone(); user.setPhone(newPhone); editData(user); @@ -97,6 +98,8 @@ public class BsUserServiceImpl implements BsUserService { session.setUser(user); SessionObject sessionObject = new SessionObject(userToken(user.getId()), session); userCenter.save(sessionObject); + // 删除缓存 + redisUtil.hdel(CACHE_KEY, oldPhone); } @Override