From f79b04663d92ee4a28468180b10bb87bfdda9763 Mon Sep 17 00:00:00 2001 From: Li-GanMa Date: Wed, 8 Nov 2023 16:52:07 +0800 Subject: [PATCH] =?UTF-8?q?api=E6=8E=A5=E5=8F=A3=E7=BB=B4=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/IPinfo.vue | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/IPinfo.vue b/src/components/IPinfo.vue index 1707301..3b588f4 100644 --- a/src/components/IPinfo.vue +++ b/src/components/IPinfo.vue @@ -60,15 +60,15 @@ const provinceMatch=(str:string)=>{ async function getLocalIp() { if(props.isVisible){ try { - const response = await fetch('https://ip.useragentinfo.com/json', { referrerPolicy: 'no-referrer' }); + const response = await fetch('https://pubstatic.b0.upaiyun.com/?_upnode', { referrerPolicy: 'no-referrer' }); let resp = await response.json(); let localInfo:any={ - ip:resp['ip'], - isp:resp['isp'], - isChinaMainland:provinceMatch(resp['province'])?true:false, - province:provinceMatch(resp['province']), - city:resp['city'].replace(/市$/, ""), - area:resp['area'] + ip:resp['remote_addr'], + isp:resp['remote_addr_location']['isp'], + isChinaMainland:provinceMatch(resp['remote_addr_location']['province'])?true:false, + province:provinceMatch(resp['remote_addr_location']['province']), + city:resp['remote_addr_location']['city'].replace(/市$/, ""), + area:'' } info['localInfo']=localInfo if(props.IPinfo){