const opts = {
appId,
scope,
state,
redirectUrl,
componentAppId,
componentAccessToken,
};
const oauth = new OAuth(opts);
const authorizeUrl = oauth.getAuthorizeUrl({ redirectUrl, scope, state });
Error {
name: 'WechatOpenOAuthError',
code: Number, // 错误代码,对应微信的错误代码
message: String, // 错误信息
}