mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-05-06 22:37:12 -04:00
fix(My IP): use https://www.ipify.org/
This commit is contained in:
parent
76425c94b7
commit
fea25b7243
2 changed files with 4 additions and 2 deletions
|
@ -4,7 +4,7 @@ import { defineTool } from '../tool';
|
|||
export const tool = defineTool({
|
||||
name: 'My IP Address',
|
||||
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'],
|
||||
component: () => import('./my-ip.vue'),
|
||||
icon: World,
|
||||
|
|
|
@ -4,7 +4,9 @@ import { useCopy } from '@/composable/copy';
|
|||
|
||||
const [clientIP, refreshClientIP] = computedRefreshableAsync(async () => {
|
||||
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) {
|
||||
return e.toString();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue