|
|
|
|
@ -45,21 +45,18 @@ public class Application {
|
|
|
|
|
* 该方法会持续监听用户输入,并根据用户当前的登录状态(已登录或未登录),
|
|
|
|
|
* 分别调用不同的处理逻辑。
|
|
|
|
|
*/
|
|
|
|
|
public void run() {
|
|
|
|
|
public void run() throws IOException {
|
|
|
|
|
System.out.println("欢迎使用中小学数学卷子自动生成程序!");
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
if (!sessionManager.isUserLoggedIn()) {
|
|
|
|
|
handleLoggedOutState();
|
|
|
|
|
} else {
|
|
|
|
|
handleLoggedInState();
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
System.out.println("error");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -210,7 +207,7 @@ public class Application {
|
|
|
|
|
* 负责创建 Application 实例并启动主循环,从而开始整个程序。
|
|
|
|
|
* @param args 命令行参数(本项目中未使用)
|
|
|
|
|
*/
|
|
|
|
|
public static void main(String[] args) {
|
|
|
|
|
public static void main(String[] args) throws IOException {
|
|
|
|
|
Application app = new Application();
|
|
|
|
|
app.run();
|
|
|
|
|
}
|
|
|
|
|
|