From 3e5e1d3d5aedfde98b7cb8821aa42cf855619c39 Mon Sep 17 00:00:00 2001 From: 15815213711 <zhaochongyi@isu6.com> Date: 星期一, 26 八月 2024 19:55:37 +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