From 500ae6f79c816e6e0ef6dda71849a438728d2ad6 Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Mon, 4 Aug 2025 18:20:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20MML=E5=91=BD=E4=BB=A4=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E5=9B=9E=E8=BD=A6\r\n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/tool/controller/mml.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/modules/tool/controller/mml.go b/src/modules/tool/controller/mml.go index 079ae666..86bb05f1 100644 --- a/src/modules/tool/controller/mml.go +++ b/src/modules/tool/controller/mml.go @@ -72,7 +72,7 @@ func (s MMLController) Command(c *gin.Context) { } // 网元主机的Telnet客户端 num := 1 - if body.Type == "Standard" { + if body.NeType == "UPF" && body.Type == "Standard" { num = 2 } telnetClient, err := s.neInfoService.NeRunTelnetClient(neInfo.NeType, neInfo.NeId, num) @@ -80,14 +80,18 @@ func (s MMLController) Command(c *gin.Context) { c.JSON(200, resp.ErrMsg(err.Error())) return } + telnetClient.RunCMD("\r\n") defer telnetClient.Close() - if body.Type == "Standard" { + if body.NeType == "UPF" && body.Type == "Standard" { telnetClient.WindowChange(1024, 1024) } // 发送MML result := []string{} for _, v := range body.Command { - output, err := telnetClient.RunCMD(v + "\r\r") + if v == "" { + continue + } + output, err := telnetClient.RunCMD(v + "\r\n") if err != nil { result = append(result, err.Error()) continue