From 14d68d0580d138cba03496dd54d978a4a003f2f2 Mon Sep 17 00:00:00 2001 From: zmzimpl Date: Mon, 11 Dec 2023 18:47:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8D=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=BB=A3=E7=90=86=E6=97=B6=E8=8E=B7=E5=8F=96=E6=9C=AC=E6=9C=BA?= =?UTF-8?q?IP=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/main/src/fingerprint/prepare.ts | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/packages/main/src/fingerprint/prepare.ts b/packages/main/src/fingerprint/prepare.ts index 15a6665..e4aa781 100644 --- a/packages/main/src/fingerprint/prepare.ts +++ b/packages/main/src/fingerprint/prepare.ts @@ -17,15 +17,13 @@ export const getProxyInfo = async (ip: string, gateway: 'ip2location' | 'geoip') let attempts = 0; const maxAttempts = 3; let localIP = ''; - if (import.meta.env.DEV) { - try { - const {data} = await api.get('https://api64.ipify.org?format=json', { - timeout: 5_000, - }); - localIP = data.ip; - } catch (error) { - logger.error(error); - } + try { + const {data} = await api.get('https://api64.ipify.org?format=json', { + timeout: 5_000, + }); + localIP = data.ip; + } catch (error) { + logger.error(error); } while (attempts < maxAttempts) {