mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-24 23:00:19 +03:00
fix(My IP): use https://www.ipify.org/
This commit is contained in:
1 parent
81258f603e
commit
68f8e3921b
2 files changed
+4
-2
No files matched your search
@@ -4,7 +4,7 @@ import { defineTool } from '../tool';
|
|||||||
export const tool = defineTool({
|
export const tool = defineTool({
|
||||||
name: 'My IP Address',
|
name: 'My IP Address',
|
||||||
path: '/my-ip',
|
path: '/my-ip',
|
||||||
description: 'Get your client IP Address (IPv4/6) using https://getjsonip.com/',
|
description: 'Get your client IP Address (IPv4/6) using https://www.ipify.org/',
|
||||||
keywords: ['my', 'client', 'ip'],
|
keywords: ['my', 'client', 'ip'],
|
||||||
component: () => import('./my-ip.vue'),
|
component: () => import('./my-ip.vue'),
|
||||||
icon: World,
|
icon: World,
|
||||||
|
|||||||
@@ -4,7 +4,9 @@ import { useCopy } from '@/composable/copy';
|
|||||||
|
|
||||||
const [clientIP, refreshClientIP] = computedRefreshableAsync(async () => {
|
const [clientIP, refreshClientIP] = computedRefreshableAsync(async () => {
|
||||||
try {
|
try {
|
||||||
return (await (await fetch('https://jsonip.com', { mode: 'cors' })).json()).ip?.toString();
|
return (await (await fetch('https://api64.ipify.org?format=json', {
|
||||||
|
mode: 'cors',
|
||||||
|
})).json()).ip?.toString();
|
||||||
}
|
}
|
||||||
catch (e: any) {
|
catch (e: any) {
|
||||||
return e.toString();
|
return e.toString();
|
||||||
|
|||||||
Reference in new issue
Block a user