feat: 报名逻辑
This commit is contained in:
18
cloudfunctions/getOpenid/index.js
Normal file
18
cloudfunctions/getOpenid/index.js
Normal file
@@ -0,0 +1,18 @@
|
||||
// 云函数入口文件
|
||||
const cloud = require("wx-server-sdk");
|
||||
|
||||
cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV }); // 使用当前云环境
|
||||
|
||||
// 云函数入口函数
|
||||
exports.main = async (event, context) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const wxContext = cloud.getWXContext();
|
||||
|
||||
resolve({
|
||||
event,
|
||||
openid: wxContext.OPENID,
|
||||
appid: wxContext.APPID,
|
||||
unionid: wxContext.UNIONID,
|
||||
});
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user