H5微信登录获取unionid
前端跳转连接拼接
const appid = '微信appid';
const scope = 'snsapi_userinfo';
const path = window.location.href;
const url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appid + '&redirect_uri=' + encodeURIComponent(current) + '&response_type=code&scope=' + scope + '&state=STATE#wechat_redirect';
接收微信重定向后的code参数
//获取参数方法
export function GetUrlParam(paraName) {
let url = document.location.toString();
let arrObj = url.split("?");
if (arrObj.length > 1) {
var