Files
yunzerwebsiteallinone/backend/public/auth-callback.html
T
2026-09-20 00:19:08 +08:00

40 lines
1.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>正在完成登录…</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
display: flex; align-items: center; justify-content: center;
min-height: 100vh; margin: 0; color: #5a6072; font-size: 14px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.box {
background: #fff; border-radius: 12px; padding: 32px 40px;
box-shadow: 0 20px 60px rgba(0,0,0,.2); text-align: center;
}
</style>
</head>
<body>
<div class="box">正在完成登录,请稍候…</div>
<script>
/**
* 统一认证中心回调中转页。
*
* 为什么不直接用 hash 路由 /#/auth/callback 作为 redirect_uri:
* URL 中的 "#" 会被浏览器当作片段标识符,其后的内容不会作为查询参数发送到服务端,
* 导致认证中心收到的 redirect_uri 被截断(只剩根路径),换不到授权码。
*
* 因此用一个不带 # 的静态页接收 code,再转发给 SPA 的 hash 路由处理。
*/
(function () {
var query = window.location.search || '';
var target = window.location.origin + '/#/auth/callback' + query;
window.location.replace(target);
})();
</script>
</body>
</html>