从前台提交数据到数据库,插入也成功了,数据也都显示了,但是想将 数据库的数据 返回给 前台时,用了ctx.res.body = result 方法,前台接收不到数据,这该怎么 解决啊?? 应该用什么方法,才能将数据在发送给前台的ajax 接收啊??


文档中说了, response body 必须是下面几种类型。
Set response body to one of the following:
string written
Buffer written
Stream piped
Object json-stringified
null no content response