36 lines
1.5 KiB
HTML
36 lines
1.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Document</title>
|
|
<script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
<button onclick="handlelogin()">微信登录</button>
|
|
<script>
|
|
// 开启 vConsole 调试面板
|
|
var vConsole = new VConsole();
|
|
// wx364b8ebf17fe45fe wx0eeb7556d60121db
|
|
console.log("✅ vConsole 已经启动");
|
|
const url = encodeURIComponent("https://ai.satabot.com?userid=6353rf")
|
|
function handlelogin() {
|
|
const APP_ID = 'wx364b8ebf17fe45fe';
|
|
const REDIRECT_URI = encodeURIComponent("https://ai.satabot.com");
|
|
const STATE = Math.random().toString(36).substring(2, 12);
|
|
const SCOPE = 'snsapi_base';
|
|
// const authUrl = `https://open.weixin.qq.com/connect/qrconnect?appid=${APP_ID}&redirect_uri=${REDIRECT_URI}&response_type=code&scope=${SCOPE}&state=${STATE}#wechat_redirect`;
|
|
// window.location.href = authUrl; // 跳转后页面刷新,后续代码不执行
|
|
window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${APP_ID}&redirect_uri=${REDIRECT_URI}&response_type=code&scope=${SCOPE}&forcePopup=false&state=${STATE}&connect_redirect=1#wechat_redirect`
|
|
}
|
|
</script>
|
|
|
|
<script>
|
|
|
|
</script>
|
|
</body>
|
|
|
|
</html> |