|
|
|
|
@ -1,16 +1,22 @@
|
|
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
|
import java.util.Scanner;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 系统界面
|
|
|
|
|
*/
|
|
|
|
|
public class ExamSystem {
|
|
|
|
|
private final Scanner scanner = new Scanner(System.in);
|
|
|
|
|
private final Scanner scanner = new Scanner(System.in, StandardCharsets.UTF_8);
|
|
|
|
|
|
|
|
|
|
public Users login() {
|
|
|
|
|
Users users = null;
|
|
|
|
|
while (users == null) {
|
|
|
|
|
System.out.print("请输入用户名和密码: ");
|
|
|
|
|
String input = scanner.nextLine();
|
|
|
|
|
if (input.equals("-1")) {
|
|
|
|
|
System.out.println("exit");
|
|
|
|
|
System.exit(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String[] parts = input.split(" ");
|
|
|
|
|
if (parts.length == 2) {
|
|
|
|
|
users = Users.login(parts[0], parts[1]);
|
|
|
|
|
|