diff --git a/README.md b/README.md index e0de811..7e60261 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Homework - - - **Last Update Time : 2023-05-07 21:06** + 日志文件:`log.md` - - - ### 运行方式: diff --git a/src/main/java/entities/dto/Login.java b/src/main/java/entities/dto/Login.java index e56a14a..18707c5 100644 --- a/src/main/java/entities/dto/Login.java +++ b/src/main/java/entities/dto/Login.java @@ -17,7 +17,7 @@ public class Login { public static boolean UserLogin(Long id) { boolean flag = false; String sql = "select password from Users where id = ?"; - + Scanner reader = new Scanner(System.in); try { conn = getConnection(); ps = conn.prepareStatement(sql); @@ -30,13 +30,9 @@ public class Login { CreateIndent();//跳转到登录选项重新输入ID } - Scanner reader = new Scanner(System.in); System.out.println("请输入登录密码:"); String password = reader.nextLine(); - while (rs.next()) { - flag = password.equals(rs.getString("password")); - } - + flag = password.equals(rs.getString("password")); } catch (Exception e) { throw new RuntimeException(e);