解决用户的重置密码的bug

This commit is contained in:
jishenghua
2025-08-06 23:20:48 +08:00
parent db479d6874
commit 324cc16882
3 changed files with 14 additions and 10 deletions

View File

@@ -197,7 +197,7 @@ public class UserService {
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int resetPwd(String md5Pwd, Long id) throws Exception{
public int resetPwd(String md5Pwd, Long id, HttpServletRequest request) throws Exception{
int result=0;
logService.insertLog("用户",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_EDIT).append(id).toString(),
@@ -211,7 +211,11 @@ public class UserService {
user.setId(id);
user.setPassword(md5Pwd);
try{
result=userMapper.updateByPrimaryKeySelective(user);
//判断是否登录过
Object userId = redisService.getObjectFromSessionByKey(request,"userId");
if (userId != null) {
result = userMapper.updateByPrimaryKeySelective(user);
}
}catch(Exception e){
JshException.writeFail(logger, e);
}