From 7f164af532f66aff71419682c5b3f531b606983a Mon Sep 17 00:00:00 2001 From: zhaochongyi <11111> Date: 星期五, 30 八月 2024 18:56:13 +0800 Subject: [PATCH] 修改初始化 --- electron/controller/port.js | 16 +++++++--------- 1 files changed, 7 insertions(+), 9 deletions(-) diff --git a/electron/controller/port.js b/electron/controller/port.js index 0f815b4..5a18768 100644 --- a/electron/controller/port.js +++ b/electron/controller/port.js @@ -1,21 +1,19 @@ -import { Controller } from "ee-core"; -import { SerialPort } from "serialport"; +const { Controller } = require("ee-core"); +const { SerialPort } = require("serialport"); const Services = require('ee-core/services') -class Port extends Controller{ +class PortController extends Controller{ constructor(ctx){ super(ctx) } async initPort(bool){ - console.log(bool) if(bool){ - SerialPort.list().then((ports)=>{ - setTimeout(()=>{ - }) - }) + return SerialPort.list(); } } -} \ No newline at end of file +} +PortController.toString = () => '[class PortController]'; +module.exports = PortController; \ No newline at end of file -- Gitblit v1.8.0