|
@@ -18,6 +18,7 @@ package org.springblade.system.user.service.impl;
|
|
|
|
|
|
|
|
|
import cn.hutool.crypto.SecureUtil;
|
|
|
+import cn.hutool.crypto.digest.MD5;
|
|
|
import com.alibaba.nacos.common.utils.MD5Utils;
|
|
|
import com.alibaba.nacos.common.utils.StringUtils;
|
|
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
@@ -60,6 +61,7 @@ import org.springblade.system.user.vo.UserVO;
|
|
|
import org.springblade.system.user.wrapper.UserWrapper;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
+import sun.security.rsa.RSASignature;
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
@@ -226,7 +228,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
|
throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount()));
|
|
|
}
|
|
|
user.setName(user.getRealName());
|
|
|
- return updateUserInfo(user);
|
|
|
+ return updateUserInfo(user) && submitUserDept(user);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -394,7 +396,7 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public boolean updatePassword(Long userId, String oldPassword, String newPassword, String newPassword1) {
|
|
|
+ public boolean updatePassword(Long userId, String oldPassword, String newPassword, String newPassword1, String plaintextPassword) {
|
|
|
User user = getById(userId);
|
|
|
if (!newPassword.equals(newPassword1)) {
|
|
|
throw new ServiceException("请输入正确的确认密码!");
|
|
@@ -403,8 +405,8 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
|
|
|
throw new ServiceException("原密码不正确!");
|
|
|
}
|
|
|
return this.update(Wrappers.<User>update().lambda()
|
|
|
+ .set(User::getPlaintextPassword, plaintextPassword)
|
|
|
.set(User::getPassword, DigestUtil.hex(newPassword))
|
|
|
- .set(User::getPlaintextPassword, newPassword)
|
|
|
.eq(User::getId, userId));
|
|
|
}
|
|
|
|