🐛 找回密码问题修复
🐛 找回密码问题修复
This commit is contained in:
commit
5a85adc384
@ -46,11 +46,11 @@ public interface UserMapper extends Mapper<User> {
|
||||
|
||||
/**
|
||||
* 修改用户密码
|
||||
* @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);
|
||||
|
||||
/**
|
||||
* 获取用户权限权重
|
||||
|
@ -131,12 +131,11 @@ public class UserServiceImpl extends AbstractService<User> 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);
|
||||
}
|
||||
|
@ -50,8 +50,8 @@
|
||||
<insert id="insertUserRole">
|
||||
insert into forest_user_role (id_user,id_role,created_time) values (#{idUser},#{idRole},sysdate())
|
||||
</insert>
|
||||
<update id="updatePasswordByAccount">
|
||||
update forest_user set password = #{password} where account = #{account}
|
||||
<update id="updatePasswordByEmail">
|
||||
update forest_user set password = #{password} where email = #{email}
|
||||
</update>
|
||||
<update id="updateUserRole">
|
||||
update forest_user_role set id_role = #{idRole},created_time = sysdate() where id_user = #{idUser}
|
||||
|
Loading…
Reference in New Issue
Block a user