From 54254d4375948c5863c4b5e7c8d444af4ef035a6 Mon Sep 17 00:00:00 2001 From: huababa1 <2037205722@qq.com> Date: Sun, 12 Oct 2025 19:09:53 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=AF=E5=A2=83=E7=9B=91=E6=B5=8B=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=AF=B9ip=E5=B8=A6=E6=9C=89=E7=AB=AF=E5=8F=A3?= =?UTF-8?q?=E5=8F=B7=E7=9A=84=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Applications/Program.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Applications/Program.cs b/Applications/Program.cs index 9dacd9d..517faf2 100644 --- a/Applications/Program.cs +++ b/Applications/Program.cs @@ -480,7 +480,19 @@ class Program // 检测学生端环境 else if (action == "/check") { - string apiUrl = "http://" + ip + ":48080/admin-api/exam/app/getAppCheckList/" + taskId; // ← 替换成你的接口地址 + Console.WriteLine("check"); + string apiUrl; + + if (ip.Contains(":")) + { + // 已包含端口号或域名带端口 + apiUrl = $"http://{ip}/admin-api/exam/app/getAppCheckList/{taskId}"; + } + else + { + // 未包含端口号 + apiUrl = $"http://{ip}:48080/admin-api/exam/app/getAppCheckList/{taskId}"; + } List softwareList = await FetchSoftwareListFromApi(apiUrl); List result = new List(); foreach (AppCheck softwareLine in softwareList)