parent
e5478db4de
commit
8ef89e26a9
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"permissions": {
|
||||||
|
"openapi": [
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
const cloud = require('wx-server-sdk');
|
||||||
|
|
||||||
|
cloud.init({
|
||||||
|
env: cloud.DYNAMIC_CURRENT_ENV
|
||||||
|
});
|
||||||
|
|
||||||
|
// 获取openId云函数入口函数
|
||||||
|
exports.main = async (event, context) => {
|
||||||
|
// 获取基础信息
|
||||||
|
const wxContext = cloud.getWXContext();
|
||||||
|
|
||||||
|
return {
|
||||||
|
openid: wxContext.OPENID,
|
||||||
|
appid: wxContext.APPID,
|
||||||
|
unionid: wxContext.UNIONID,
|
||||||
|
};
|
||||||
|
};
|
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"name": "getOpenId",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
},
|
||||||
|
"author": "",
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"wx-server-sdk": "~2.6.3"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue