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

This commit is contained in:
TsMask committed 2024-04-24 15:35:57 +08:00
1 parent 3ea6285112
commit 03c3520279
1 file changed
+6 -1
@@ -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
}
}