From b24764845168fb1251c66c6a858a5536b6b0f078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=98=89=E4=BC=9F?= <8473136@qq.com> Date: Sun, 11 Aug 2024 18:57:03 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E7=AB=AF=E5=8F=A3?= =?UTF-8?q?=E6=89=AB=E6=8F=8F=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- electron/api/local.ts | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/electron/api/local.ts b/electron/api/local.ts index fbd9fab..87dad75 100644 --- a/electron/api/local.ts +++ b/electron/api/local.ts @@ -33,7 +33,7 @@ export const initLocalApi = () => { if (process.platform === 'win32') { // window ports = stdout.split('\r\n') - .filter(f => f.indexOf('TCP') > 0 || f.indexOf('UDP') > 0) + .filter(f => f.indexOf('TCP') !== -1 || f.indexOf('UDP') !== -1) .map(m => { const cols = m.split(' ') .filter(f => f != '') @@ -41,17 +41,6 @@ export const initLocalApi = () => { const s = local.lastIndexOf(":") let localIP = local.slice(0, s); let localPort = local.slice(s - local.length + 1); - console.log(1) - // if (local.indexOf('[') == -1) { - // // ipv4 - // const tmp = cols[1].split(":") - // localIP = tmp[0] - // localPort = tmp[1] - // } else { - // // ipv6 - // console.log(1) - // } - const singe: LocalPort = { protocol: cols[0], ip: localIP, @@ -73,7 +62,6 @@ export const initLocalApi = () => { const cols = m.split(' ') .filter(f => f != '') const local = cols[3] - console.log(local, '1') const s = local.lastIndexOf(".") let localIP = local.slice(0, s); let localPort = local.slice(s - local.length + 1); @@ -100,7 +88,6 @@ export const initLocalApi = () => { const s = local.lastIndexOf(":") let localIP = local.slice(0, s); let localPort = local.slice(s - local.length + 1); - console.log(1) const singe: LocalPort = { protocol: cols[0], ip: localIP,