1
export async function getPlaces(ctx, next) {
const { error, data } = await PlaceModel.getPlaces(ctx.query);
console.log(error, data);
if (error) {
return ctx.throw(422, error);
}
ctx.body = data;
}
Koa每次发送404状态和空身,我在做什么错?Koa每次发送状态404是
404通常意味着Koa找不到匹配url的路由,你确定上面的函数叫做? –
是的,我敢肯定,console.log的工作原理 –
围绕await调用尝试了'try/catch'吗? – zeronone