<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
<html>
|
<head>
|
<title>qq账号绑定</title>
|
|
<meta http-equiv="pragma" content="no-cache">
|
<meta http-equiv="cache-control" content="no-cache">
|
<meta http-equiv="expires" content="0">
|
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
|
<meta http-equiv="description" content="This is my page">
|
<!--
|
<link rel="stylesheet" type="text/css" href="styles.css">
|
-->
|
<script type="text/javascript" src="${base}/static/script/jquery.js"></script>
|
<script type="text/javascript" src="${base}/static/plugins/easyui/jquery.easyui.min.js"></script>
|
<script type="text/javascript">
|
$(function(){
|
var access = window.location.hash.split("&");//获取路径中的access_token
|
//var accessTokens = access[0].split("=");
|
var accessTokens = access[0].split("#");
|
var accessToken=accessTokens[1];
|
$.ajax({
|
type: 'GET',
|
url: 'https://graph.qq.com/oauth2.0/me?'+accessToken,
|
async: false,
|
dataType: "jsonp",
|
jsonp: "callback",//传递给请求处理程序或页面的,用以获得jsonp回调函数名的参数名(一般默认为:callback)
|
jsonpCallback:"callback",
|
success: function(o){
|
// console.log(o);//o就是上面提到的返回包
|
$.ajax({
|
type: 'POST',
|
url:"get_user_info.html",
|
data:{openid:o.openid},
|
async: false,
|
dataType: "json",
|
success: function(e){
|
if(e=='1'){
|
$.post("${base}/uc/qqUserLogin.html",{"openid":o.openid},function(data){
|
if(data==1){
|
window.top.popupTips("绑定成功");
|
window.location.href = "${base}/uc/myDetail.html";
|
}
|
});
|
}else if(e=='2'){
|
window.top.popupTips("该QQ账号已经绑定过");
|
}
|
}
|
});
|
|
}
|
});
|
});
|
</script>
|
</head>
|
|
<body style="padding-top:100px;background:#00aff0;text-align:center;">
|
<table width="100%" height="400px">
|
<tr><td align="center">
|
<img src="${base}/static/usercenter/images/goto-logo.gif" style="margin:100px auto;" />
|
</td>
|
</tr>
|
<tr><td align="center">
|
<img src="${base}/static/usercenter/images/loading-circle.gif" style="margin:100px auto;" />
|
</td>
|
</tr>
|
</table>
|
</body>
|
</html>
|