Browse Source

fix: forget change flag argument

Hugh Harlequin 1 năm trước cách đây
mục cha
commit
974151cb2a
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      index.js

+ 2 - 2
index.js

@@ -10,8 +10,8 @@ xhr.addEventListener("loadend", async function (e){
     let ip = responseObj.ip;
     let regionData = await ipToRegion(ip);
     let country = window.location.protocol === 'https:' ? regionData.country_name : regionData.geoplugin_countryName
-    if (window.regionMap[regionData.geoplugin_countryName]) {
-        window.location.href = window.regionMap[regionData.geoplugin_countryName]
+    if (window.regionMap[country]) {
+        window.location.href = window.regionMap[country]
     }
 });
 xhr.send();