fix: MML命令执行回车\r\n
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user