export const getWeChatAuthCode = () => {
  return new Promise((resolve, reject) => {
    // 条件编译微信小程序、抖音小程序
    let provider = "";
    // #ifdef MP-WEIXIN
    provider = "weixin";
    // #endif

    // #ifdef MP-TOUTIAO
    provider = "toutiao";
    // #endif

    uni.login({
      provider,
      success: (res) => {
        console.log("微信登录成功", res);
        resolve(res.code);
      },
      fail: (err) => {
        reject(err);
      },
    });
  });
};
