获取code时,截取回调url中的code
/** * 获取链接中的code
* key 为键,key=code/auth_code(wx:code=asfgasg54654,ali:auth_code=ag6465a4s6g5d)
**/
function getUrlValue(key){ var url = location.search; var theRequest = new Object(); if (url.indexOf("?") != -1) { var str = url.substr(1); strs = str.split("&"); for (var i = 0; i < strs.length; i++) { theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]); } } var value = theRequest[key]; userCode = value; return value; }

浙公网安备 33010602011771号