How to use the wx-server-sdk.getWXContext function in wx-server-sdk

To help you get started, we’ve selected a few wx-server-sdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github anpeier / lesson_shuidi / wxapp / yun_book / cloudfunctions / login / index.js View on Github external
exports.main = (event, context) => {
  console.log(event)
  console.log(context)

  // 可执行其他自定义逻辑
  // console.log 的内容可以在云开发云函数调用日志查看

  // 获取 WX Context (微信调用上下文),包括 OPENID、APPID、及 UNIONID(需满足 UNIONID 获取条件)等信息
  const wxContext = cloud.getWXContext()

  return {
    event,
    openid: wxContext.OPENID,
    appid: wxContext.APPID,
    unionid: wxContext.UNIONID,
    env: wxContext.ENV,
  }
}
github poyiding / bookshelfMiniApp / cloudfunctions / login / index.js View on Github external
exports.main = (event, context) => {
  // 可执行其他自定义逻辑
  // console.log 的内容可以在云开发云函数调用日志查看

  // 获取 WX Context (微信调用上下文),包括 OPENID、APPID、及 UNIONID(需满足 UNIONID 获取条件)
  const wxContext = cloud.getWXContext()

  return {
    event,
    openid: wxContext.OPENID,
    appid: wxContext.APPID,
    unionid: wxContext.UNIONID,
  }
}
github coderZsq / coderZsq.practice.web / study-notes / mini-program / 02-小程序云开发 / cloudfunctions / login / index.js View on Github external
exports.main = async (event, context) => {
  const wxContext = cloud.getWXContext()

  return {
    event,
    openid: wxContext.OPENID, // 当前用户在小程序中唯一标识
    appid: wxContext.APPID, // 小程序的唯一标识
    unionid: wxContext.UNIONID, // 不是任意小程序都可以获取 (不可以标识出用户在多个我们的平台使用微信登录)
  }
}
github rhinoc / Resser / cloudfunctions / getOpenId / index.js View on Github external
exports.main = async (event, context) => {
  const wxContext = cloud.getWXContext()
  return wxContext.OPENID;
}
github huangjianke / Gitter / cloud / functions / openid / index.js View on Github external
exports.main = async (event, context) => {
  const wxContext = cloud.getWXContext()

  return {
    event,
    openid: wxContext.OPENID,
    appid: wxContext.APPID,
    unionid: wxContext.UNIONID,
  }
}

wx-server-sdk

mini program cloud server sdk

MIT
Latest version published 2 months ago

Package Health Score

56 / 100
Full package analysis

Popular wx-server-sdk functions

Similar packages