过滤掉COM1口
parent
7a09eb3d0d
commit
c2a7c0ada4
|
@ -45,7 +45,7 @@ SerialPort.list().then((ports, err) => {
|
|||
// console.log(ports, '=====================')
|
||||
|
||||
// 过滤掉COM1口,很多电脑自带COM1接口
|
||||
ports.filter((port) => port.path != 'COM1')
|
||||
ports = ports.filter((port) => port.path != 'COM1')
|
||||
if (ports.length == 0) {
|
||||
console.error('设备为连接')
|
||||
return
|
||||
|
|
Loading…
Reference in New Issue