error message wx is not defined是什么原因?
云函数定义如下
const cloud=require( 'wx-server-sdk' ); cloud.init() const db=wx.cloud.database(); // 云函数入口函数 exports.main = async (event, context) => { try { await db.collection( 'users' ).where({ username: "zhangsan" }).remove() } catch (e){ console.log(e) } } |