From 8cffd3dc21f8b7d53ec191fb73d4a01dc4d53869 Mon Sep 17 00:00:00 2001 From: Xuwznln <18435084+Xuwznln@users.noreply.github.com> Date: Wed, 10 Sep 2025 20:13:44 +0800 Subject: [PATCH] fix: addr param --- unilabos/app/main.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/unilabos/app/main.py b/unilabos/app/main.py index 4dc79bbc..e0bf2cbe 100644 --- a/unilabos/app/main.py +++ b/unilabos/app/main.py @@ -222,6 +222,13 @@ def main(): # 加载配置文件 print_status(f"当前工作目录为 {working_dir}", "info") load_config_from_file(config_path, args_dict["labid"]) + if args_dict["addr"] == "test": + print_status("使用测试环境地址", "info") + HTTPConfig.remote_addr = "https://uni-lab.test.bohrium.com/api/v1" + elif args_dict["addr"] == "local": + print_status("使用本地环境地址", "info") + HTTPConfig.remote_addr = "http://127.0.0.1:48197/api/v1" + HTTPConfig.remote_addr = args_dict.get("addr", "") if args_dict["use_remote_resource"]: print_status("使用远程资源启动", "info") @@ -237,13 +244,6 @@ def main(): # 设置BasicConfig参数 BasicConfig.ak = args_dict.get("ak", "") BasicConfig.sk = args_dict.get("sk", "") - if args_dict["addr"] == "test": - print_status("使用测试环境地址", "info") - HTTPConfig.remote_addr = "https://uni-lab.test.bohrium.com/api/v1" - elif args_dict["addr"] == "local": - print_status("使用本地环境地址", "info") - HTTPConfig.remote_addr = "http://127.0.0.1:48197/api/v1" - HTTPConfig.remote_addr = args_dict.get("addr", "") BasicConfig.working_dir = working_dir BasicConfig.is_host_mode = not args_dict.get("without_host", False) BasicConfig.slave_no_host = args_dict.get("slave_no_host", False)