跳至内容
未找到。
抱歉,没有找到收据。
请求的收据无效
返回主页
document.addEventListener(
"DOMContentLoaded",
function(){
const btn=document.getElementById(
"pi-login-btn"
);
if(btn){
btn.onclick=function(){
const scopes=[
"username"
];
Pi.authenticate(
scopes,
function(payment){
console.log(payment);
}
)
.then(function(auth){
console.log(auth);
alert(
"Welcome "
+
auth.user.username
);
})
.catch(function(error){
console.log(error);
});
}
}
});