cy
2022-06-21 129904537f66509f97b285e7eb4f42b3dc349dd0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!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>