微信认证

function getQueryString(name) {
    var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
    var r = window.location.search.substr(1).match(reg);
    if (r != null) {
        return unescape(r[2]);
    }
    return null;
}


openid =getQueryString("openid");
if(!openid)
    window.location.href = weixin;


//服务器接口
var serverurl="https://www.gamedo.net/";
//获取微信认证接口
var weixin=serverurl+"wechatdmbj.action";

你可能感兴趣的:(js)