testLogin.html 855 Bytes
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, viewport-fit=cover">
    <meta http-equiv="X-UA-Compatible" content="chrome=1,IE=edge">
    <title>Title</title>
</head>
<body>
<button id="aaa">232323</button>
<button class="auth">1111111</button>
<a class="auth" href="http://www.baidu.com">123123</a>
<div id="uid"></div>
<div id="url"></div>
<script src="http://ad.yoho.cn/build/sdk.js"></script>
<script>
    window.yo_sdk.auth();
    document.getElementById('aaa').onclick = function (event) {
        window.yo_sdk.getUid().then(function(uid){
            console.log(uid);
            document.getElementById('uid').innerText = uid;
        })
    }
    document.getElementById('url').innerText = location.href;
</script>
</body>
</html>