fix(My IP): use https://www.ipify.org/
This commit is contained in:
		
							parent
							
								
									76425c94b7
								
							
						
					
					
						commit
						fea25b7243
					
				| @ -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(); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user