|
|
|
|
@ -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);
|
|
|
|
|
|