From a54e9402ac0a2943cf860001f55309ecb5370392 Mon Sep 17 00:00:00 2001 From: lingling <1077478963@qq.com> Date: Tue, 10 Dec 2024 20:24:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=9F=E6=88=90=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=E6=97=B6=E4=B8=8D=E6=B7=BB=E5=8A=A0=E4=BC=AA=E8=A3=85?= =?UTF-8?q?=E5=9F=9F=E5=90=8D=E5=92=8Csni=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/api.ts | 9 +++++---- src/components/LinkItem.vue | 2 ++ src/components/OriginalLinkItem.vue | 1 - src/pages/CreateLink.vue | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/api/api.ts b/src/api/api.ts index cd5054c..5700133 100644 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -13,12 +13,13 @@ class getdata { return tmp } async get_country(ip: string) { - let res = await api.post('https://api.giaogiao.uk/server/searchip', { + const res = await api.post('https://api.giaogiao.uk/server/searchip', { ip, }); - res = res.data.country - if (typeof (res) == 'string') { return res } - return '' + // res = res.data.country + // if (typeof (res) == 'string') { return res } + // console.log(res.data.data.country) + return res.data.data.country } async get_server_ms(ip: string, port: number, to_ip: string, istls: number) { diff --git a/src/components/LinkItem.vue b/src/components/LinkItem.vue index ace82b2..c751bca 100644 --- a/src/components/LinkItem.vue +++ b/src/components/LinkItem.vue @@ -59,6 +59,8 @@ export default defineComponent({ if (props.serve.istls == 1 && vless.params) { vless.params.security = 'tls' vless.params.path = `/${ip}` + vless.params.host = props.serve.host + vless.params.sni = props.serve.host } api.get_server_ms(props.serve.host, props.serve.port, ip, props.serve.istls).then((res) => { console.log(res) diff --git a/src/components/OriginalLinkItem.vue b/src/components/OriginalLinkItem.vue index 886885e..7d594de 100644 --- a/src/components/OriginalLinkItem.vue +++ b/src/components/OriginalLinkItem.vue @@ -58,7 +58,6 @@ export default defineComponent({ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion vless.params!.security = 'none' api.get_server_ms(ip, 9000, '', 0).then((res) => { - console.log(res) time.value = res.time online.value = res.is_online }) diff --git a/src/pages/CreateLink.vue b/src/pages/CreateLink.vue index 69cb4ca..b27d4e0 100644 --- a/src/pages/CreateLink.vue +++ b/src/pages/CreateLink.vue @@ -46,6 +46,7 @@ export default defineComponent({ // outlink.value += await CreatVmessDirect(array[index]) let vless = vlessLink let country = await api.get_country(array[index]) + console.log(country) vless.name = country + array[index] vless.host = array[index] outlink.value += CreateLink('vless', vless) + '\n'