oauth.html 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <!DOCTYPE html>
  2. <html lang="zh">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>微信网页授权测试</title>
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
  8. <link rel="stylesheet" href="__ROOT__/static/theme/css/mobile.css">
  9. <script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
  10. </head>
  11. <body>
  12. {if empty($fans.fansinfo)}
  13. <fieldset style="width:80%;margin:1rem auto">
  14. <legend style="padding:0.2rem 0.3rem;font-size:0.9rem;color:#666">操作失败</legend>
  15. <div style="padding-top:0.4rem">
  16. <p style="font-size:0.6rem;margin-bottom:0.8rem">通过网页授权获取用户资料失败,请检查权限再试!</p>
  17. <p style="font-size:0.6rem;margin-bottom:0.8rem">
  18. <a href="javascript:void(0);" onclick="location.reload()">重新获取(刷新)</a>
  19. </p>
  20. </div>
  21. </fieldset>
  22. {else}
  23. <div class="header" style="padding:1rem 0 0.6rem 0;text-align:center">
  24. <img alt="img" style='width:132px;height:132px;border-radius:50%;border:0.6rem solid rgba(150,40,40,0.6)' src="{$fans.fansinfo.headimgurl}">
  25. <h1>{$fans.fansinfo.nickname}</h1>
  26. </div>
  27. <fieldset style="width:80%;margin:0.6rem auto">
  28. <legend style="padding:0.2rem 0.3rem;font-size:0.9rem;color:#666">用户标识</legend>
  29. <div style="padding-top:0.4rem">
  30. <div style="font-size:0.8rem;margin-bottom:0.3rem;color:#999">OPENID</div>
  31. <p style="font-size:0.6rem;margin-bottom:0.8rem">{$fans.fansinfo.openid}</p>
  32. <div style="font-size:0.8rem;margin-bottom:0.3rem;color:#999">UNIONID</div>
  33. <p style="font-size:0.6rem;margin-bottom:0.8rem">{$fans.fansinfo.unionid|default='未获取到'}</p>
  34. </div>
  35. </fieldset>
  36. <fieldset style="width:80%;margin:0.6rem auto">
  37. <legend style="padding:0.2rem 0.3rem;font-size:0.9rem;color:#666">详细资料</legend>
  38. <div style="padding-top:0.4rem">
  39. <div style="font-size:0.8rem;margin-bottom:0.3rem;color:#999">性别</div>
  40. <p style="font-size:0.6rem;margin-bottom:0.8rem">{:[1=>'男',2=>'女'][$fans.fansinfo.sex]??'未知'}</p>
  41. <div style="font-size:0.8rem;margin-bottom:0.3rem;color:#999">系统语言</div>
  42. <p style="font-size:0.6rem;margin-bottom:0.8rem">{$fans.fansinfo.language}</p>
  43. <div style="font-size:0.8rem;margin-bottom:0.3rem;color:#999">所在区域</div>
  44. <p style="font-size:0.6rem;margin-bottom:0.8rem">{$fans.fansinfo.country} - {$fans.fansinfo.province} - {$fans.fansinfo.city}</p>
  45. {if isset($fans.fansinfo.privilege.0)}
  46. <div style="font-size:0.8rem;margin-bottom:0.3rem;color:#999">设备网络</div>
  47. <p style="font-size:0.6rem;margin-bottom:0.8rem">{$fans.fansinfo.privilege.0|default='未获取到网络信息'}</p>
  48. {/if}
  49. </div>
  50. </fieldset>
  51. {/if}
  52. </body>
  53. </html>