fix: MML-udm dec key后查看内容

This commit is contained in:
TsMask
2025-09-25 15:35:03 +08:00
parent 9f653c650b
commit cb7e7f574b

View File

@@ -102,10 +102,14 @@ func (s MMLController) Command(c *gin.Context) {
// 发送MML // 发送MML
result := []string{} result := []string{}
resultStr := "Success" resultStr := "Success"
hasCommand := false
for _, v := range body.Command { for _, v := range body.Command {
if v == "" { if v == "" {
continue continue
} }
if strings.Contains(v, "dec key") {
hasCommand = true
}
output, err := telnetClient.RunCMD(v + "\r\n") output, err := telnetClient.RunCMD(v + "\r\n")
if err != nil { if err != nil {
result = append(result, err.Error()) result = append(result, err.Error())
@@ -115,6 +119,16 @@ func (s MMLController) Command(c *gin.Context) {
result = append(result, strings.TrimSpace(output)) result = append(result, strings.TrimSpace(output))
} }
// UDM 特殊命令处理
if body.NeType == "UDM" && hasCommand {
output, err := s.neInfoService.NeRunSSHCmd(neInfo.NeType, neInfo.NeId, "cat /usr/local/etc/udm/ueKeyProfile.tmp")
if err != nil {
result = append(result, err.Error())
} else {
result = append(result, output)
}
}
// 记录日志 // 记录日志
mmlLog := model.MMLLog{ mmlLog := model.MMLLog{
NeType: body.NeType, NeType: body.NeType,