"use strict";
const common_vendor = require("../common/vendor.js");
function auth() {
  return new Promise((resolve, reject) => {
    common_vendor.index.login({
      provider: "weixin",
      //使用微信登录
      onlyAuthorize: true,
      //不弹出授权页面，直接进入微信登录流程
      success(res) {
        if (res.errMsg == "login:ok") {
          resolve(res.code);
        } else {
          common_vendor.index.showToast({
            title: res.errMsg,
            icon: "error"
          });
        }
      },
      fail(err) {
        reject(err);
      }
    });
  });
}
exports.auth = auth;
//# sourceMappingURL=../../.sourcemap/mp-weixin/utils/auth.js.map
