소스 검색

fix: forget change flag argument

Hugh Harlequin 1 년 전
부모
커밋
974151cb2a
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      index.js

+ 2 - 2
index.js

@@ -10,8 +10,8 @@ xhr.addEventListener("loadend", async function (e){
     let ip = responseObj.ip;
     let ip = responseObj.ip;
     let regionData = await ipToRegion(ip);
     let regionData = await ipToRegion(ip);
     let country = window.location.protocol === 'https:' ? regionData.country_name : regionData.geoplugin_countryName
     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();
 xhr.send();