This commit is contained in:
richboo111
2023-04-27 11:55:54 +08:00
parent d775e408eb
commit a2e183b5b9
3 changed files with 20 additions and 13 deletions

View File

@@ -177,7 +177,7 @@ func Render(conn *websocket.Conn, messageId string, code int, message string, da
})
}
func ClientRender(w http.ResponseWriter, code int, msg string, data interface{}) (str string) {
func ClientRender(code int, msg string, data interface{}) (str string) {
var retData RetData
retData.Code = code
@@ -187,6 +187,7 @@ func ClientRender(w http.ResponseWriter, code int, msg string, data interface{})
retJson, _ := json.Marshal(retData)
str = string(retJson)
var w http.ResponseWriter
w.Header().Set("Content-Type", "application/json; charset=utf-8")
_, _ = io.WriteString(w, str)
return