Browse Source

fix: forget change flag argument

Hugh Harlequin 1 year ago
parent
commit
974151cb2a
1 changed files with 2 additions and 2 deletions
  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();