过滤掉COM1口
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user