fix: upf mml

This commit is contained in:
2023-11-29 10:28:01 +08:00
parent 97598556c6
commit 5870e3e820

View File

@@ -138,15 +138,15 @@ func PostMMLToNF(w http.ResponseWriter, r *http.Request) {
mmlRequest := new(MMLRequest)
_ = json.Unmarshal(body, mmlRequest)
n, err = conn.Read(buf[0:])
if err != nil {
log.Error("Failed to read:", err)
mmlResult = append(mmlResult, err.Error())
response := Response{mmlResult}
services.ResponseWithJson(w, http.StatusOK, response)
return
}
log.Debug(string(buf[0:n]))
// n, err = conn.Read(buf[0:])
// if err != nil {
// log.Error("Failed to read:", err)
// mmlResult = append(mmlResult, err.Error())
// response := Response{mmlResult}
// services.ResponseWithJson(w, http.StatusOK, response)
// return
// }
// log.Debug(string(buf[0:n]))
loginStr := fmt.Sprintf("%s\n%s\n", config.GetYamlConfig().MML.User, config.GetYamlConfig().MML.Password)
_, err = conn.Write([]byte(loginStr))