环境监测增加对ip带有端口号的判断
This commit is contained in:
@@ -480,7 +480,19 @@ class Program
|
|||||||
// 检测学生端环境
|
// 检测学生端环境
|
||||||
else if (action == "/check")
|
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<AppCheck> softwareList = await FetchSoftwareListFromApi(apiUrl);
|
List<AppCheck> softwareList = await FetchSoftwareListFromApi(apiUrl);
|
||||||
List<string> result = new List<string>();
|
List<string> result = new List<string>();
|
||||||
foreach (AppCheck softwareLine in softwareList)
|
foreach (AppCheck softwareLine in softwareList)
|
||||||
|
Reference in New Issue
Block a user