PasswordSetType

This commit is contained in:
MaxKey
2021-07-31 22:12:17 +08:00
parent 8210d11fa3
commit 494b2b01d0
4 changed files with 16 additions and 12 deletions

View File

@@ -214,9 +214,10 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
}
public boolean changePassword(String oldPassword,
String newPassword,
String confirmPassword) {
public boolean changePassword( String oldPassword,
String newPassword,
String confirmPassword,
int passwordSetType) {
try {
WebContext.setAttribute(PasswordPolicyValidator.PASSWORD_POLICY_VALIDATE_RESULT, "");
UserInfo userInfo = WebContext.getUserInfo();
@@ -225,6 +226,7 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
changeUserInfo.setPassword(newPassword);
changeUserInfo.setId(userInfo.getId());
changeUserInfo.setDecipherable(userInfo.getDecipherable());
changeUserInfo.setPasswordSetType(passwordSetType);
if(newPassword.equals(confirmPassword)){
if(oldPassword==null ||

View File

@@ -95,12 +95,12 @@
<update id="changePassword" parameterType="UserInfo" >
update mxk_userinfo set
<if test="password != null">
password = #{password},
decipherable = #{decipherable},
</if>
passwordsettype = 0,
passwordlastsettime = current_timestamp
<if test="password != null">
password = #{password},
decipherable = #{decipherable},
passwordsettype = #{passwordSetType},
</if>
passwordlastsettime = current_timestamp
where
id = #{id}
</update>