随手精灵小程序,单独为了获取WIFI信息加强围栏告警功能能力
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.

26 lines
501B

  1. const cloud = require('wx-server-sdk')
  2. cloud.init({
  3. // API 调用都保持和云函数当前所在环境一致
  4. env: cloud.DYNAMIC_CURRENT_ENV
  5. })
  6. // 云函数入口函数
  7. exports.main = async (event, context) => {
  8. console.log(event)
  9. const { OPENID } = cloud.getWXContext()
  10. const result = await cloud.openapi.customerServiceMessage.send({
  11. touser: OPENID,
  12. msgtype: 'text',
  13. text: {
  14. content: `收到:${event.Content}`,
  15. }
  16. })
  17. console.log(result)
  18. return result
  19. }