Commit 7bdd69ee by Yuchao Shen

修改数据返回

parent e56c546b
......@@ -29,8 +29,9 @@ func {{.HandlerName}}(svcCtx *svc.ServiceContext) http.HandlerFunc {
httpx.Error(w, err)
} else {
typ := reflect.TypeOf(resp)
val := reflect.ValueOf(resp)
if typ.Kind() == reflect.String {
_, _ = w.Write([]byte(resp))
_, _ = w.Write([]byte(val.String()))
httpx.Ok(w)
} else {
{{if .HasResp}}httpx.OkJson(w, resp){{else}}httpx.Ok(w){{end}}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment