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'