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