// 不存在code 发起授权
const wxParams = {
appid: RSAdecrypt(urlConfig.wxConfig.appid_Encrypt),
redirect_uri: encodeURIComponent(href), // 授权后重定向的回调链接地址
response_type: 'code',
scope: 'snsapi_userinfo'
// state: 'STATE'
}
window.location.href = 'https://open.weixin.qq.com/connect/oauth2/authorize?' + toUrlParams(wxParams) + '#wechat_redirect'
export function RSAdecrypt(obj, key = '') {
//key为解密私钥,obj为需要解密的数据
let _decryp = new JSEncrypt()
_decryp.setPrivateKey(privateKey) //设置解密私钥
return _decryp.decrypt(obj) //返回通过decryptUnicodeLong方法解密后的结果
// return _decryp.decryptLong(obj); //返回通过decryptLong方法解密后的结果
}