feat(config): 更新基础网络地址为生产环境地址将 GlobalConfig 中的基础网络地址从本地开发地址替换为生产环境地址,
同时优化 LoginView 界面布局,使标签与输入框左对齐,并调整组件间距。
This commit is contained in:
@@ -11,7 +11,8 @@ public class GlobalConfig {
|
|||||||
/**
|
/**
|
||||||
* 基础网络地址
|
* 基础网络地址
|
||||||
*/
|
*/
|
||||||
public static final String BASE_NET_URL = "http://127.0.0.1:9606";
|
//public static final String BASE_NET_URL = "http://127.0.0.1:9606";
|
||||||
|
public static final String BASE_NET_URL = "http://139.155.27.186:9607";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 登录接口地址
|
* 登录接口地址
|
||||||
|
|||||||
@@ -65,18 +65,18 @@ public class LoginView {
|
|||||||
ProgressIndicator progressIndicator = new ProgressIndicator();
|
ProgressIndicator progressIndicator = new ProgressIndicator();
|
||||||
progressIndicator.setPrefSize(30, 30);
|
progressIndicator.setPrefSize(30, 30);
|
||||||
progressIndicator.setVisible(false);
|
progressIndicator.setVisible(false);
|
||||||
|
|
||||||
// 添加登录按钮事件处理
|
// 添加登录按钮事件处理
|
||||||
loginButton.setOnAction(e -> {
|
loginButton.setOnAction(e -> {
|
||||||
// 获取用户输入的账号和密码
|
// 获取用户输入的账号和密码
|
||||||
String account = accountField.getText();
|
String account = accountField.getText();
|
||||||
String password = passwordField.getText();
|
String password = passwordField.getText();
|
||||||
|
|
||||||
// 显示加载指示器,禁用登录按钮
|
// 显示加载指示器,禁用登录按钮
|
||||||
progressIndicator.setVisible(true);
|
progressIndicator.setVisible(true);
|
||||||
loginButton.setDisable(true);
|
loginButton.setDisable(true);
|
||||||
loginButton.setText("登录中...");
|
loginButton.setText("登录中...");
|
||||||
|
|
||||||
// 在新线程中执行登录操作
|
// 在新线程中执行登录操作
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
@@ -92,7 +92,7 @@ public class LoginView {
|
|||||||
progressIndicator.setVisible(false);
|
progressIndicator.setVisible(false);
|
||||||
loginButton.setDisable(false);
|
loginButton.setDisable(false);
|
||||||
loginButton.setText("登 录");
|
loginButton.setText("登 录");
|
||||||
|
|
||||||
if (jsonResultObject.getInteger("code") != 200) {
|
if (jsonResultObject.getInteger("code") != 200) {
|
||||||
// 显示错误提示弹窗
|
// 显示错误提示弹窗
|
||||||
Alert alert = new Alert(Alert.AlertType.ERROR);
|
Alert alert = new Alert(Alert.AlertType.ERROR);
|
||||||
@@ -124,7 +124,7 @@ public class LoginView {
|
|||||||
progressIndicator.setVisible(false);
|
progressIndicator.setVisible(false);
|
||||||
loginButton.setDisable(false);
|
loginButton.setDisable(false);
|
||||||
loginButton.setText("登 录");
|
loginButton.setText("登 录");
|
||||||
|
|
||||||
// 显示错误提示弹窗
|
// 显示错误提示弹窗
|
||||||
Alert alert = new Alert(Alert.AlertType.ERROR);
|
Alert alert = new Alert(Alert.AlertType.ERROR);
|
||||||
alert.setTitle("登录失败");
|
alert.setTitle("登录失败");
|
||||||
@@ -138,10 +138,21 @@ public class LoginView {
|
|||||||
}
|
}
|
||||||
}).start();
|
}).start();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 创建标签容器,使文本标签与输入框左对齐
|
||||||
|
Label accountLabel = new Label("账号:");
|
||||||
|
accountLabel.setPrefWidth(400);
|
||||||
|
accountLabel.setStyle("-fx-alignment: center-left;");
|
||||||
|
|
||||||
|
Label passwordLabel = new Label("密码:");
|
||||||
|
passwordLabel.setPrefWidth(400);
|
||||||
|
passwordLabel.setStyle("-fx-alignment: center-left;");
|
||||||
|
|
||||||
// 添加组件到主容器
|
// 添加组件到主容器
|
||||||
root.getChildren().addAll(titleLabel, infoLabel, new Label("账号"), accountField,
|
root.getChildren().addAll(titleLabel, infoLabel, accountLabel, accountField,
|
||||||
new Label("密码"), passwordField, loginButton, progressIndicator);
|
passwordLabel, passwordField,
|
||||||
|
new Label(""), // 添加一个空标签以增加间距
|
||||||
|
loginButton, progressIndicator);
|
||||||
|
|
||||||
// 设置场景并显示窗口
|
// 设置场景并显示窗口
|
||||||
Scene scene = new Scene(root, 400, 600);
|
Scene scene = new Scene(root, 400, 600);
|
||||||
|
|||||||
Reference in New Issue
Block a user