From de91b3bac775c61ad6b6c674b545366f3563cfda Mon Sep 17 00:00:00 2001 From: novohit Date: Thu, 5 Oct 2023 12:10:50 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=AB=AF=E5=8F=A3=E6=9B=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FckESC/Core/LoginIntranet.cs | 8 ++++---- FckESC/Util/NetworkUtil.cs | 2 +- ...1\347\231\273\345\275\225\350\277\207\347\250\213.txt" | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/FckESC/Core/LoginIntranet.cs b/FckESC/Core/LoginIntranet.cs index b6a591b..75066e8 100644 --- a/FckESC/Core/LoginIntranet.cs +++ b/FckESC/Core/LoginIntranet.cs @@ -29,7 +29,7 @@ public static async Task LoginAsync(string account, string password) httpClient.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("*/*")); httpClient.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36 Edg/87.0.664.66"); - var httpResponse = await httpClient.GetAsync("http://172.17.18.2:8080/byod/index.xhtml"); + var httpResponse = await httpClient.GetAsync("http://172.17.18.2:9092/byod/index.xhtml"); if (httpResponse.IsSuccessStatusCode) { @@ -61,7 +61,7 @@ public static async Task LoginAsync(string account, string password) var content = new StringContent(data); content.Headers.ContentType.MediaType = "application/x-www-form-urlencoded"; - httpResponse = await httpClient.PostAsync("http://172.17.18.2:8080/byod/index.xhtml", content); + httpResponse = await httpClient.PostAsync("http://172.17.18.2:9092/byod/index.xhtml", content); // 清空,后面用 var redirectUrl = ""; @@ -72,7 +72,7 @@ public static async Task LoginAsync(string account, string password) // 重定向的地址 redirectUrl = httpResponse.RequestMessage.RequestUri.ToString(); Console.WriteLine(redirectUrl); - // "http://172.17.18.2:8080/byod/templatePage/20200318110733542/guestRegister.jsf" + // "http://172.17.18.2:9092/byod/templatePage/20200318110733542/guestRegister.jsf" httpResponse = await httpClient.GetAsync(redirectUrl); if (httpResponse.IsSuccessStatusCode) @@ -123,7 +123,7 @@ public static async Task LoginAsync(string account, string password) Regex regex = new Regex("(?<=url=\").+ (?= \")"); if (regex.IsMatch(html)) { - redirectUrl = "http://172.17.18.2:8080" + regex.Match(html).Value; + redirectUrl = "http://172.17.18.2:9092" + regex.Match(html).Value; httpResponse = await httpClient.GetAsync(redirectUrl); if (httpResponse.IsSuccessStatusCode) diff --git a/FckESC/Util/NetworkUtil.cs b/FckESC/Util/NetworkUtil.cs index 2335de2..9a44633 100644 --- a/FckESC/Util/NetworkUtil.cs +++ b/FckESC/Util/NetworkUtil.cs @@ -91,7 +91,7 @@ public static async Task ConnectAsync() { // 上面没拿到,就尝试用tcp连接,看看能不能成。 // 如果走到这里,八成是连接不上了。 - if (tcp.ConnectAsync(INTRANETIP, 8080).Wait(1500)) + if (tcp.ConnectAsync(INTRANETIP, 9092).Wait(1500)) { string ip = ((System.Net.IPEndPoint)tcp.Client.LocalEndPoint).Address.ToString(); Console.WriteLine(ip); diff --git "a/\345\206\205\347\275\221\347\231\273\345\275\225\350\277\207\347\250\213.txt" "b/\345\206\205\347\275\221\347\231\273\345\275\225\350\277\207\347\250\213.txt" index d062de8..aff5631 100644 --- "a/\345\206\205\347\275\221\347\231\273\345\275\225\350\277\207\347\250\213.txt" +++ "b/\345\206\205\347\275\221\347\231\273\345\275\225\350\277\207\347\250\213.txt" @@ -19,14 +19,14 @@ javax.faces.ViewState: N8QBoU0SYLMEO+J0+0V4WpquoRG+Cg9rDflycI7/6S5H9PnJi51MrnySv N8QBoU0SYLMEO%2BJ0%2B0V4WpquoRG%2BCg9rDflycI7%2F6S5OmdqsPyrlwDTzgp834LDpOP6v%2FBr0DZjEK3JJ4cK3QMKaiLNL%2FK6vFOhgGx%2BspSOsElJt -无cookie状态,打开http://172.17.18.2:8080/byod/index.xhtml, +无cookie状态,打开http://172.17.18.2:9092/byod/index.xhtml, 找到action="/byod/index.xhtml;jsessionid=7E3F85BF2279D91EBF7E01C7AD088238", 并找到参数javax.faces.ViewState=N8QBoU0SYLMEO%2BJ0%2B0V4WpquoRG%2BCg9rDflycI7%2F6S5OmdqsPyrlwDTzgp834LDpOP6v%2FBr0DZjEK3JJ4cK3QMKaiLNL%2FK6vFOhgGx%2BspSOsElJt (等号后面要进行url编码) -对http://172.17.18.2:8080/byod/index.xhtml;jsessionid=7E3F85BF2279D91EBF7E01C7AD088238进行post请求 +对http://172.17.18.2:9092/byod/index.xhtml;jsessionid=7E3F85BF2279D91EBF7E01C7AD088238进行post请求 参数为 wlannasid=&usermac=&userurl=&userip=&ssid=&btn=&j_id_3_SUBMIT=1&javax.faces.ViewState=N8QBoU0SYLMEO%2BJ0%2B0V4WpquoRG%2BCg9rDflycI7%2F6S5OmdqsPyrlwDTzgp834LDpOP6v%2FBr0DZjEK3JJ4cK3QMKaiLNL%2FK6vFOhgGx%2BspSOsElJt