hotime/example/tpt/pc.html
2022-05-05 16:07:01 +08:00

33 lines
1.4 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>微信登录</title>
<script type="text/javascript" src="js/hotime.js"></script>
</head>
<body>
<script>
function run() {
var data={"timestamp": window.H.getParam("timestamp"),"sn":window.H.getParam("sn")}
// if(data.code==null){
// location.href='https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx4d97696b9ecb49fc&redirect_uri='+location.href+'&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect'
// return
// }
window.H.post("app/upan/login", data, function (res) {
if (res.status != 0) {
alert(res.result.msg)
return
}
// let res = { "result": { "acttoken": "56_ogEfWa4mglG-Ilf2kD50FfekZWimJXUouZ4gMKmkVP2CwcLwv2lHO35LOn5NSLOQ-yEAZcIs3FvgIBhk2uF9CA", "appid": "wx4d97696b9ecb49fc", "avatar": "https://thirdwx.qlogo.cn/mmopen/vi_32/Q0j4TwGTfTLNj0yKXe77H8C60ic2lUFIx5hkibf0FluNCRfTkiazrBfuqclqRhm4nDug9Hx3nsXQhtzNdfchAvJTQ/132", "nickname": "候鸟半夏", "openid": "oPoZT6juCkF6fvnMHrCFI6SK_vK8", "retoken": "56_tjuJPobvbLVvOPtqPRZjTzQHR7i3Vmx_aGXOy9j0WsNTFS_JRnb4ArmUGhWtq6e7eCpUnPNKulIQ44CPiBnYEA", "unionid": "ofKK36PEkbIt0xMMUgch4H-bVaFI" }, "status": 0 }
location.href="/#/home"
})
}
run()
</script>
</body>
</html>