From 52e5dc09a89cf21597a77fc066e7f7f196d92b75 Mon Sep 17 00:00:00 2001 From: humility <793039998@qq.com> Date: Thu, 11 Jan 2024 17:16:36 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E6=89=93=E5=8D=B0ping=E4=B8=8D?= =?UTF-8?q?=E9=80=9A=E4=BF=A1=E6=81=AF=2001-11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/computer.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib/computer.ts b/src/lib/computer.ts index b5c18ee..29af876 100644 --- a/src/lib/computer.ts +++ b/src/lib/computer.ts @@ -1,9 +1,9 @@ /** * @Author : Humility * @Date : 2023-07-13 10:28:04 - * @LastEditTime : 2023-07-28 16:29:08 - * @LastEditors : LST-Public - * @FilePath : \miot-pc-switch-bemfa\src\lib\computer.ts + * @LastEditTime : 2024-01-11 16:07:27 + * @LastEditors : Humility + * @FilePath : \humble-switch-bemfa\src\lib\computer.ts * @Description : */ // 子进程 @@ -111,12 +111,14 @@ export class Computer extends BemfaDevice { } else if (process.platform == "linux") { pingCMD = `ping -c 1 -w 1 ${this.ip}`; } else { - console.log(new Date(), "platform error"); + console.log(new Date(), "platform not supported"); } try { execSync(pingCMD); return 1; } catch (error) { + console.log(new Date(), "get status error"); + console.warn(error); return 0; } }