|
|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
package ui;
|
|
|
|
|
|
|
|
|
|
import controller.AppController;
|
|
|
|
|
import controller.UserManager;
|
|
|
|
|
import util.EmailUtil;
|
|
|
|
|
|
|
|
|
|
import javax.swing.*;
|
|
|
|
|
@ -109,7 +110,15 @@ public class RegisterPanel extends JPanel {
|
|
|
|
|
JOptionPane.showMessageDialog(this, "密码需包含大小写字母与数字,长度6-10位!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//防止用户名重复
|
|
|
|
|
if (controller.getUserManager().isUsernameExists(username)) {
|
|
|
|
|
JOptionPane.showMessageDialog(this, "用户名已存在,请更换!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (username.isEmpty() || password.isEmpty() || email.isEmpty() || code.isEmpty()) {
|
|
|
|
|
JOptionPane.showMessageDialog(this, "请填写完整信息!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
controller.handleRegister(email, password, username); // 传递username
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|