fix(server): empty data wrapping

This commit is contained in:
chenos 2022-12-01 09:58:11 +08:00
parent ec94565259
commit 34c9ec123e
2 changed files with 5 additions and 1 deletions

View File

@ -15,7 +15,7 @@ export async function get(ctx: Context, next) {
context: ctx, context: ctx,
}); });
ctx.body = instance || {}; ctx.body = instance || null;
await next(); await next();
} }

View File

@ -47,6 +47,10 @@ export function dataWrapping() {
data: ctx.body, data: ctx.body,
}; };
} }
} else if (ctx.action) {
ctx.body = {
data: ctx.body,
};
} }
}; };
} }