更换IP查询api
This commit is contained in:
parent
68da8b649e
commit
839629eb4a
|
@ -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 };
|
||||||
|
|
|
@ -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'
|
||||||
|
|
Loading…
Reference in New Issue