云函数 "await" 对此表达式的类型没有影响?
exports.main = async (event, context) => {
const wxContext = cloud.getWXContext();
const app = new TcbRouter({ event });
app.use(async (ctx, next) => {
ctx.data = {};
await next();
});
app.router('MyContributeManage', async (ctx, next) => {
const result = await db.collection('Guardian')
.aggregate()
.match({
userId: wxContext.UNIONID,
}).end();
ctx.body = { data: (result.list.length > 0) ? result.list[0] : {} }
});
return app.serve();
}
这东西跟云函数没关系 ,编辑器问题吧,我这没这个提示