From 78a09e9eabe44b9545c689438c0862c54d2bcd84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=AB=8B=E5=B8=AE?= <3294713004@qq.com> Date: Sun, 11 May 2025 16:42:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(core):=20=E4=BF=AE=E5=A4=8D=E5=9C=A8?= =?UTF-8?q?=E7=BA=BF=E7=89=88ampy=E6=9F=90=E4=BA=9B=E6=83=85=E5=86=B5?= =?UTF-8?q?=E4=B8=8B=E6=9F=A5=E6=89=BE=20`>ok`=20=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=EF=BC=8C=E6=94=B9=E4=B8=BA=E6=9F=A5=E6=89=BE=20`ok`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/modules/mixly-modules/web/ampy.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/common/modules/mixly-modules/web/ampy.js b/common/modules/mixly-modules/web/ampy.js index 26f37ca1..909f1635 100644 --- a/common/modules/mixly-modules/web/ampy.js +++ b/common/modules/mixly-modules/web/ampy.js @@ -166,11 +166,13 @@ class AmpyExt extends Ampy { if (data.length < 1) { throw new Error(Msg.Lang['ampy.waitingFirstEOFTimeout']); } - let start = data.toLowerCase().indexOf('>ok'); - if (start === -1){ + let start = data.toLowerCase().lastIndexOf('ok'); + if (start === -1) { start = 0; + } else { + start += 2; } - data = data.substring(start + 3, data.length - 1); + data = data.substring(start, data.length - 1); let dataError = await this.readUntil('\x04', true, timeout); if (dataError.length < 1) { throw new Error(Msg.Lang['ampy.secondEOFTimeout']);