'use strict'; const _ = require('lodash'); // 将特殊的查询,service返回为{data,total}的情况转换为通常查询结果:即把{}展开 module.exports = options => { return async function dealquery(ctx, next) { await next(); const body = ctx.response.body; const { data, errcode, errmsg } = body; ctx.response.body = { ...data, errcode, errmsg }; }; };