From 839629eb4a127ea209f1c676acbee97e0ddb8fe7 Mon Sep 17 00:00:00 2001 From: lingling Date: Wed, 22 Mar 2023 23:01:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=8D=A2IP=E6=9F=A5=E8=AF=A2api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/api.ts | 2 +- src/pages/CreateLink.vue | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/api/api.ts b/src/api/api.ts index 47e854b..e599e81 100644 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -7,7 +7,7 @@ class getdata { return await api.post('https://api.shagain.club/textserver', { url }); } 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 }; diff --git a/src/pages/CreateLink.vue b/src/pages/CreateLink.vue index 8cb2be4..bec7efd 100644 --- a/src/pages/CreateLink.vue +++ b/src/pages/CreateLink.vue @@ -49,7 +49,8 @@ export default defineComponent({ outlink.value = '' for (let index = 0; index < array.length; index++) { 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.add = array[index] outlink.value += 'vmess://' + encode(JSON.stringify(obj)) + '\n'