diff --git a/routers/private/tool.go b/routers/private/tool.go index 0e3ea72aa..c7d08430b 100755 --- a/routers/private/tool.go +++ b/routers/private/tool.go @@ -5,6 +5,7 @@ package private import ( + "encoding/json" "fmt" "net/http" @@ -68,7 +69,9 @@ func ShowModel(ctx *macaron.Context) { modelResult, count, err := repo.QueryModelByParameters(repoId, 5) if err == nil { log.Info("count=" + fmt.Sprint(count)) - ctx.JSON(200, modelResult) + modelResultjson, _ := json.Marshal(modelResult) + + ctx.JSON(200, (string(modelResultjson))) } else { ctx.JSON(500, "query error.") }