小bug修改
This commit is contained in:
parent
ab306eff80
commit
47de8a8c65
@ -1,6 +1,7 @@
|
||||
# Homework
|
||||
- - -
|
||||
**Last Update Time : 2023-05-07 21:06**
|
||||
|
||||
日志文件:`log.md`
|
||||
- - -
|
||||
### 运行方式:
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user