fix: 网元测试telnet连接的响应

This commit is contained in:
TsMask
2024-04-24 15:35:57 +08:00
parent 3ea6285112
commit 03c3520279

View File

@@ -203,7 +203,12 @@ func (s *NeHostController) Test(c *gin.Context) {
return
}
defer client.Close()
c.JSON(200, result.Ok(nil))
if strings.HasSuffix(client.LastResult, "> ") {
c.JSON(200, result.Ok(nil))
} else {
// 连接主机失败,请检查连接参数后重试
c.JSON(200, result.ErrMsg(i18n.TKey(language, "neHost.errByHostInfo")))
}
return
}
}