增加忘记密码功能完善

陈映江 5 months ago committed by Gitea
parent 6a64cb556f
commit 94bf12af62

@ -1,7 +1,5 @@
package mathlearning.ui;
import at.favre.lib.crypto.bcrypt.BCrypt;
import mathlearning.model.User;
import mathlearning.service.EmailService;
import mathlearning.service.UserService;
@ -194,20 +192,17 @@ public class ChangeCodeFrame extends JFrame {
"请填写所有字段", "错误", JOptionPane.ERROR_MESSAGE);
return;
}
if (!password.equals(confirmPassword)) {
JOptionPane.showMessageDialog(ChangeCodeFrame.this,
"两次输入的密码不一致", "错误", JOptionPane.ERROR_MESSAGE);
return;
}
if (!userService.validatePassword(password)) {
JOptionPane.showMessageDialog(ChangeCodeFrame.this,
"密码必须为6-10位且包含大小写字母和数字", "错误", JOptionPane.ERROR_MESSAGE);
return;
}
// 使用新的重置密码方法
if (userService.resetPasswordWithCode(email, code, password)) {
JOptionPane.showMessageDialog(ChangeCodeFrame.this,
"密码重置成功!", "成功", JOptionPane.INFORMATION_MESSAGE);

Loading…
Cancel
Save