|
|
|
|
@ -766,13 +766,32 @@ public class CLIApplication {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void switchToGUI() {
|
|
|
|
|
System.out.println("\n切换到 GUI 版本...");
|
|
|
|
|
System.out.println("请运行: java -jar gui-1.0.0-all.jar");
|
|
|
|
|
System.out.println("\n[系统] 正在启动 GUI 客户端...");
|
|
|
|
|
try {
|
|
|
|
|
ProcessBuilder pb = new ProcessBuilder("cmd", "/c", "start", "cmd", "/k",
|
|
|
|
|
"gradle", ":gui:run", "--no-daemon", "-q");
|
|
|
|
|
pb.directory(new java.io.File(System.getProperty("user.dir")));
|
|
|
|
|
pb.start();
|
|
|
|
|
System.out.println("[系统] GUI 客户端已启动,CLI 即将退出...");
|
|
|
|
|
System.exit(0);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
System.out.println("[错误] 启动失败: " + e.getMessage());
|
|
|
|
|
System.out.println("提示:请确保已安装 Gradle 并配置环境变量");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void switchToWeb() {
|
|
|
|
|
System.out.println("\n切换到 Web 版本...");
|
|
|
|
|
System.out.println("请访问: http://localhost:8082");
|
|
|
|
|
System.out.println("\n[系统] 正在启动 Web 服务...");
|
|
|
|
|
try {
|
|
|
|
|
if (java.awt.Desktop.isDesktopSupported()) {
|
|
|
|
|
java.awt.Desktop.getDesktop().browse(new java.net.URI("http://localhost:8082"));
|
|
|
|
|
System.out.println("[系统] 已打开浏览器访问 Web 版本");
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("请访问: http://localhost:8082");
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
System.out.println("请访问: http://localhost:8082");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void showAppQRCode() {
|
|
|
|
|
|