@eooce/idx 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +2 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -842,14 +842,14 @@ async function getMetaInfo() {
|
|
|
842
842
|
try {
|
|
843
843
|
const response1 = await axios.get('https://api.ip.sb/geoip', { headers: { 'User-Agent': 'Mozilla/5.0', timeout: 3000 }});
|
|
844
844
|
if (response1.data && response1.data.country_code && response1.data.isp) {
|
|
845
|
-
return `${response1.data.country_code}_${response1.data.isp}
|
|
845
|
+
return `${response1.data.country_code}_${response1.data.isp}`.replace(/\s+/g, '_');
|
|
846
846
|
}
|
|
847
847
|
} catch (error) {
|
|
848
848
|
try {
|
|
849
849
|
// 备用 ip-api.com 获取isp
|
|
850
850
|
const response2 = await axios.get('http://ip-api.com/json', { headers: { 'User-Agent': 'Mozilla/5.0', timeout: 3000 }});
|
|
851
851
|
if (response2.data && response2.data.status === 'success' && response2.data.countryCode && response2.data.org) {
|
|
852
|
-
return `${response2.data.countryCode}_${response2.data.org}
|
|
852
|
+
return `${response2.data.countryCode}_${response2.data.org}`.replace(/\s+/g, '_');
|
|
853
853
|
}
|
|
854
854
|
} catch (error) {
|
|
855
855
|
// console.error('Backup API also failed');
|