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}