diff --git a/src/imgzip/LoginSignIn/ChangePassword.java b/src/imgzip/LoginSignIn/ChangePassword.java index 4f9e2e0ae0ce35adf7709cab567fb5a91ca3f492..89ad12fdae2905da71a0f6de467b70dcfa3a0cb7 100644 --- a/src/imgzip/LoginSignIn/ChangePassword.java +++ b/src/imgzip/LoginSignIn/ChangePassword.java @@ -79,7 +79,7 @@ public class ChangePassword { if(judgeIsLogined == 0){ new LoginBeginner(); }else if(judgeIsLogined == 1){ - new Pane_sceenbeginner(); + new Personal(); } }); @@ -141,7 +141,7 @@ class ChangePasswordSuccessfully{ }); }else { primaryStage.setOnCloseRequest(e->{ - new Pane_sceenbeginner(); + new Personal(); }); } diff --git a/src/imgzip/LoginSignIn/CreateAccountController.java b/src/imgzip/LoginSignIn/CreateAccountController.java index 5554d3bb22c91a84a1442cd42e46480567adf750..033d4e39f5941e54b5b98f0bb54f341a6e2ff53c 100644 --- a/src/imgzip/LoginSignIn/CreateAccountController.java +++ b/src/imgzip/LoginSignIn/CreateAccountController.java @@ -189,7 +189,7 @@ public class CreateAccountController { createAccountInstruction.queryUpdate(currentInstruction); /** - 检查数据库中是否成功插入数据 + 检查数据库中是否成功插入数据,如果没有插入数据,则会跳出提醒框提醒用户 */ String currentInstruction2 = "SELECT pwd FROM login WHERE userName=" + "'" + userName.getText().trim() + "'"; rs = createAccountInstruction.queryExcecute(currentInstruction2); diff --git a/src/imgzip/LoginSignIn/FindPasswordController.java b/src/imgzip/LoginSignIn/FindPasswordController.java index d6c7bccfb2792eb84ae7b952abfde933241e93d1..cfdc2e8fcae3c87989504ded77cf04a94882fdbd 100644 --- a/src/imgzip/LoginSignIn/FindPasswordController.java +++ b/src/imgzip/LoginSignIn/FindPasswordController.java @@ -86,6 +86,10 @@ public class FindPasswordController { Stage stage = (Stage)account.getScene().getWindow(); stage.close(); + + /** + * 当用户认证失败时,告诉用户是账户名错误还是邮箱错误。 + */ }else { AlertWindow alertWindow = new AlertWindow("验证失败","YOUR EMAIL IS WRONG"); // 此处写警告弹窗的标题和内容 // 用于新加按钮,可以新加多个,最后添加在VBox中 diff --git a/src/imgzip/LoginSignIn/LoginController.java b/src/imgzip/LoginSignIn/LoginController.java index 5bd721b097b54b1e73b4b52fb68f6d24c0aa04d8..3dec2ecded6610d51c727b5cc98822a32bd8d6f6 100644 --- a/src/imgzip/LoginSignIn/LoginController.java +++ b/src/imgzip/LoginSignIn/LoginController.java @@ -11,6 +11,7 @@ import java.io.FileWriter; import java.sql.ResultSet; import java.sql.SQLException; +import java.util.ArrayList; /** @@ -114,6 +115,16 @@ public class LoginController { GlobalStringManager.setAccount(account.getText()); loadPicturesSequences(); + /** + * 测试是否载入成功 + */ +// ArrayList now = new ArrayList<>(); +// now = GlobalStringManager.getPicSequences(); +// for (int i = 0 ; i < now.size() ; i++){ +// System.out.println(now.get(i)); +// } + + Stage stage = (Stage)account.getScene().getWindow(); new Personal(); stage.close(); @@ -195,10 +206,13 @@ public class LoginController { } - + /** + * 加载用户的图片序列。 + * 图片序列是指:用户在上传图像的时候会得到一个随机的,一一对应的图片序列码,用于从服务器中提取对应的图片。 + * 当用户登录时,程序会访问数据库中储存的所有序列码,并加载到全局变量类中供其他页面获取。 + */ public void loadPicturesSequences(){ - DataBaseController loadingInstruction = new DataBaseController(); ResultSet rs = null; try{ @@ -207,13 +221,14 @@ public class LoginController { rs = loadingInstruction.queryExcecute(currentInstruction); if(rs.next()){ - + rs.last(); int columnCount = rs.getRow(); + rs.first(); for(int i = 1 ; i <= columnCount ; i++){ - GlobalStringManager.setPicSequences(rs.getString(i)); + GlobalStringManager.setPicSequences(rs.getString(1)); + System.out.println(rs.getString(1)); + rs.next(); } - - } }catch (SQLException e){ @@ -223,11 +238,6 @@ public class LoginController { loadingInstruction.close(); } - - - } - - } diff --git a/src/imgzip/mainpane/Change_email.java b/src/imgzip/mainpane/Change_email.java index 10a4e5ceddf0520a228e39903aa1b053b87fb506..3fd046721254be85ac6d353ba00179c7a8fb0167 100644 --- a/src/imgzip/mainpane/Change_email.java +++ b/src/imgzip/mainpane/Change_email.java @@ -21,6 +21,8 @@ public class Change_email { primaryStage.setScene(new Scene(root, 400, 300)); primaryStage.show(); + + }catch (Exception e){ e.printStackTrace(); } diff --git a/txtFile/RememberAccount&Password.txt b/txtFile/RememberAccount&Password.txt index da6f3a9768ceee85123c01fed3b4a619609d8319..d4fad7ae91aa08d2757cd54a1c328b08b5e2954d 100644 --- a/txtFile/RememberAccount&Password.txt +++ b/txtFile/RememberAccount&Password.txt @@ -1 +1 @@ -asdfgh|asdfgh|true +wxlll|1234|true