🐛 修复端口扫描判断
This commit is contained in:
parent
79f48ca22b
commit
b247648451
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user