更换IP查询api

This commit is contained in:
lingling 2023-03-22 23:01:13 +08:00
parent 68da8b649e
commit 839629eb4a
2 changed files with 3 additions and 2 deletions

View File

@ -7,7 +7,7 @@ class getdata {
return await api.post('https://api.shagain.club/textserver', { url }); return await api.post('https://api.shagain.club/textserver', { url });
} }
async get_country(ip: string) { async get_country(ip: string) {
return await api.get(`https://ip.useragentinfo.com/json?ip=${ip}`); return await api.post('https://api.shagain.club/api.php?type=searchip', { ip });
} }
} }
export { getdata }; export { getdata };

View File

@ -49,7 +49,8 @@ export default defineComponent({
outlink.value = '' outlink.value = ''
for (let index = 0; index < array.length; index++) { for (let index = 0; index < array.length; index++) {
api.get_country(array[index]).then(res => { api.get_country(array[index]).then(res => {
let name = res.data.country == '中国' ? res.data.province : res.data.country // let name = res.data.country == '' ? res.data.province : res.data.country
let name = res.data.country
obj.ps = name + array[index] obj.ps = name + array[index]
obj.add = array[index] obj.add = array[index]
outlink.value += 'vmess://' + encode(JSON.stringify(obj)) + '\n' outlink.value += 'vmess://' + encode(JSON.stringify(obj)) + '\n'