From ee122134d8dcc6bbd5951c0edbfc89a6694639e7 Mon Sep 17 00:00:00 2001 From: ronger Date: Tue, 14 Sep 2021 20:43:40 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E6=89=BE=E5=9B=9E=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/rymcu/forest/mapper/UserMapper.java | 4 ++-- .../com/rymcu/forest/service/impl/UserServiceImpl.java | 7 +++---- src/main/java/mapper/UserMapper.xml | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/rymcu/forest/mapper/UserMapper.java b/src/main/java/com/rymcu/forest/mapper/UserMapper.java index f23b726..6b7df09 100644 --- a/src/main/java/com/rymcu/forest/mapper/UserMapper.java +++ b/src/main/java/com/rymcu/forest/mapper/UserMapper.java @@ -46,11 +46,11 @@ public interface UserMapper extends Mapper { /** * 修改用户密码 - * @param account + * @param email * @param password * @return */ - Integer updatePasswordByAccount(@Param("account") String account, @Param("password") String password); + Integer updatePasswordByEmail(@Param("email") String email, @Param("password") String password); /** * 获取用户权限权重 diff --git a/src/main/java/com/rymcu/forest/service/impl/UserServiceImpl.java b/src/main/java/com/rymcu/forest/service/impl/UserServiceImpl.java index 88ae98b..bdd47c1 100644 --- a/src/main/java/com/rymcu/forest/service/impl/UserServiceImpl.java +++ b/src/main/java/com/rymcu/forest/service/impl/UserServiceImpl.java @@ -131,12 +131,11 @@ public class UserServiceImpl extends AbstractService implements UserServic @Override public Map forgetPassword(String code, String password) { Map map = new HashMap<>(2); - String account = redisService.get(code); - System.out.println("account:\n"+account); - if(StringUtils.isBlank(account)){ + String email = redisService.get(code); + if(StringUtils.isBlank(email)){ map.put("message","链接已失效"); } else { - userMapper.updatePasswordByAccount(account,Utils.entryptPassword(password)); + userMapper.updatePasswordByEmail(email,Utils.entryptPassword(password)); map.put("message","修改成功,正在跳转登录登陆界面!"); map.put("flag",1); } diff --git a/src/main/java/mapper/UserMapper.xml b/src/main/java/mapper/UserMapper.xml index d7e0615..449e5f7 100644 --- a/src/main/java/mapper/UserMapper.xml +++ b/src/main/java/mapper/UserMapper.xml @@ -50,8 +50,8 @@ insert into forest_user_role (id_user,id_role,created_time) values (#{idUser},#{idRole},sysdate()) - - update forest_user set password = #{password} where account = #{account} + + update forest_user set password = #{password} where email = #{email} update forest_user_role set id_role = #{idRole},created_time = sysdate() where id_user = #{idUser}