export const getOpenId = (appid, secret, code) => {
  return new Promise((resolve, reject) => {
    uni.request({
      url: 'https://api.weixin.qq.com/sns/jscode2session',
      method: 'GET',
      data: {
        appid: appid, //你的小程序的APPID
        secret: secret, //你的小程序的secret,
        js_code: code, //wx.login 登录成功后的code
        grant_type: 'authorization_code',
      },
      success: res => {
        if (res.statusCode === 200) {
          resolve(res.data);
        }
      },
    });
  });
};
