wxr
2024-09-27 2a900e186e9ddf97facd33082df063183c7483b8
HDL_ON/UI/UI1-Login/RegisterPageBLL.cs
@@ -778,33 +778,29 @@
            waitPage.Start(Language.StringByID(StringId.PleaseWait));
            System.Threading.Tasks.Task.Run(async () =>
            {
            System.Threading.Tasks.Task.Run(() => {
                try
                {
                    string country = "CN";
                    try
                    {
                        using (HttpClient client = new HttpClient())
                        {
                            // 使用 ipinfo.io 获取位置信息
                            HttpResponseMessage response = await client.GetAsync("https://ipinfo.io/json");
                            if (response.IsSuccessStatusCode)
                            {
                                string json = await response.Content.ReadAsStringAsync();
                                JObject jsonObject = JObject.Parse(json);
                                // 从返回的 JSON 中提取国家信息
                                country = jsonObject["country"].ToString();
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        MainPage.Log("Error",$"Error fetching IP info: {ex.StackTrace}");
                    }
                    //string country = "CN";
                    //try
                    //{
                    //    using (HttpClient client = new HttpClient())
                    //    {
                    //        // 使用 ipinfo.io 获取位置信息
                    //        HttpResponseMessage response = await client.GetAsync("https://ipinfo.io/json");
                    //        if (response.IsSuccessStatusCode)
                    //        {
                    //            string json = await response.Content.ReadAsStringAsync();
                    //            JObject jsonObject = JObject.Parse(json);
                    //            // 从返回的 JSON 中提取国家信息
                    //            country = jsonObject["country"].ToString();
                    //        }
                    //    }
                    //}
                    //catch (Exception ex)
                    //{
                    //    MainPage.Log("Error",$"Error fetching IP info: {ex.StackTrace}");
                    //}
                    serverList = new List<GlobalRegionListRes>();
                    var requestJson = HttpUtil.GetSignRequestJson(new GetRegionListObj() { regionMark = HttpUtil.RegionMark });
@@ -819,7 +815,7 @@
                                serverList = responseDataObj;
                                if (serverList.Count > 0)
                                {
                                    if (country == "CN")//if (Language.CurrentLanguage == "Chinese")
                                    if (Language.CurrentLanguage == "Chinese")//if (country == "CN")//
                                    {
                                        var server = serverList.Find((obj) => obj.regionUrl.Contains("china-gateway"));
                                        if (server != null)
@@ -847,9 +843,9 @@
                        IMessageCommon.Current.ShowErrorInfoAlter(revertObj.Code);
                    }
                }
                catch
                catch (Exception ex)
                {
                    MainPage.Log("Error", $"获取服务器异常:{ex.StackTrace}");
                }
                finally
                {