1.appid 必须是当前公众号的appid
2.跳转的服务器url必须是编码格式
3.如果传参的话必须在state里面传参
var a = window.location.search.substring(1);
var userCode = a.split('&')[1].substring(9);
var phone = a.split('&')[0].substring(6);
var state = userCode + ";" + phone;
if( $.cookie("openId") == undefined || $.cookie("openId") == '' ){
window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa72daf5f7f12b731&redirect_uri=http%3A%2F%2Fsunshineweixinpaytest.eedusky.com%2FSunInsurance%2Fuser%2Findex&response_type=code&scope=snsapi_base&state="+state+"#wechat_redirect";
}