From 194150b911ec13d3ccbf854b6d8ade71d92b17d7 Mon Sep 17 00:00:00 2001 From: sin365 <353374337@qq.com> Date: Mon, 6 Jan 2025 01:12:21 +0800 Subject: [PATCH] =?UTF-8?q?urlcode=E8=BF=98=E6=98=AF=E7=94=A8axihttp?= =?UTF-8?q?=E9=87=8C=E7=9A=84=E5=90=A7=EF=BC=8C=E4=BF=9D=E8=AF=81=E5=85=BC?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Assets/Script/AppMain/Manager/HttpAPI.cs | 25 +++---------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/HttpAPI.cs b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/HttpAPI.cs index d118f271..06efc208 100644 --- a/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/HttpAPI.cs +++ b/AxibugEmuOnline.Client/Assets/Script/AppMain/Manager/HttpAPI.cs @@ -14,27 +14,7 @@ namespace AxibugEmuOnline.Client public delegate void GetRomListAPI(Action callback, int page, int pageSize = 10); public delegate void SearchRomListAPI(Action callback, string searchKey, int page, int pageSize = 10); - public static string UrlEncode(string str) - { - StringBuilder sb = new StringBuilder(); - - foreach (char c in str) - { - if ((c >= '0' && c <= '9') || - (c >= 'a' && c <= 'z') || - (c >= 'A' && c <= 'Z') || - c == '-' || c == '_' || c == '.' || c == '!' || c == '~' || c == '*' || c == '\'' || c == '(' || c == ')') - { - sb.Append(c); - } - else - { - sb.Append('%').Append(((int)c).ToString("X2")); - } - } - - return sb.ToString(); - } + public void GetNesRomList(Action callback, int page, int pageSize = 10) { App.StartCoroutine(GetNesRomListFlow(page, pageSize, callback)); @@ -50,7 +30,8 @@ namespace AxibugEmuOnline.Client if (!string.IsNullOrEmpty(searchKey)) { string oldsearch = searchKey; - searchKey = System.Net.WebUtility.UrlEncode(searchKey); + //searchKey = System.Net.WebUtility.UrlEncode(searchKey); + searchKey = AxiHttp.UrlEncode(searchKey); App.log.Info($"search->{oldsearch} ->{searchKey}"); //searchKey = HttpUtility.UrlDecode(searchKey); }