UnionID
- 云函数 cloud.getWXContext 获取不到 UNIONID
云函数代码如下:
const cloud = require(‘wx-server-sdk’)
cloud.init()
exports.main = async (event, context) => {
return {
OPENID, APPID, UNIONID
} = cloud.getWXContext()
}
1 回复
UNIONID 不是每个人都有的, 可以看下官方介绍.
https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/union-id.html