收藏
回答

关于云开发小程序获取公众号access_token问题?

云开发小程序 出现了这种错误

网上版本都试了一遍,都不太成功,想问问原因是什么?

回答关注问题邀请回答
收藏

1 个回答

  • 老张
    老张
    2020-09-07

    那你肯定需要的是这段代码:换上公众号的appid和secret

    const rp = require('request-promise')
    
    exports.main = async (event, context) => {
    
      options = {
        uri: 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=' + event.AppID + '&secret=' + event.AppSecret + '',
        json: true
      }
      return await rp(options)
    }
    
    2020-09-07
    有用 1
    回复
登录 后发表内容
问题标签