fix: MML-udm dec key后查看内容
This commit is contained in:
@@ -102,10 +102,14 @@ func (s MMLController) Command(c *gin.Context) {
|
||||
// 发送MML
|
||||
result := []string{}
|
||||
resultStr := "Success"
|
||||
hasCommand := false
|
||||
for _, v := range body.Command {
|
||||
if v == "" {
|
||||
continue
|
||||
}
|
||||
if strings.Contains(v, "dec key") {
|
||||
hasCommand = true
|
||||
}
|
||||
output, err := telnetClient.RunCMD(v + "\r\n")
|
||||
if err != nil {
|
||||
result = append(result, err.Error())
|
||||
@@ -115,6 +119,16 @@ func (s MMLController) Command(c *gin.Context) {
|
||||
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{
|
||||
NeType: body.NeType,
|
||||
|
||||
Reference in New Issue
Block a user