'use strict'; exports.main = async (event, context) => { const db = uniCloud.database() if (event.api === 'getByID') { const res = await db.collection('dishes').where({ _id: event.id }).get() return res } if (event.api === 'getFloorList') { const res = await db.collection('dishes').skip(4).limit(15).get() return res } if (event.api === 'getByName') { const res = await db.collection('dishes').where({ dish_name: new RegExp(event.dish_name, 'g') }).get() return res } //返回数据给客户端 return "请求错误" };