You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
git/scr/论坛/cloud/love_addZan/index.js

20 lines
475 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

// 云函数入口文件
const cloud = require('wx-server-sdk')
cloud.init()
const db = cloud.database()
// 云函数入口函数
exports.main = async (event, context) => {
//event 是调用云函数是输入的数据是一个类对象。context 用于获取用户信息,也是一个类对象。
try{
return await db.collection('love_zan').add({
data:{
openid:event.openid,
id:event.id,
type:1
}
})
}catch(e){
}
}