59 lines
1.7 KiB
HTML
59 lines
1.7 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="zh-CN">
|
||
<head>
|
||
<meta charset="UTF-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||
<meta name="theme-color" content="#ffffff" />
|
||
<title>正在完成登录…</title>
|
||
<link rel="preload" as="image" href="/loading.gif" />
|
||
<style>
|
||
html, body { height: 100%; }
|
||
body {
|
||
margin: 0;
|
||
display: flex; align-items: center; justify-content: center;
|
||
background: #fff;
|
||
}
|
||
.loading-wrap {
|
||
display: flex;
|
||
flex-direction: column;
|
||
align-items: center;
|
||
}
|
||
.loading-gif {
|
||
display: block;
|
||
width: 160px;
|
||
max-width: 45vw;
|
||
height: auto;
|
||
}
|
||
.loading-text {
|
||
margin: 6px 0 0;
|
||
font-size: 14px;
|
||
color: #8a8f9c;
|
||
letter-spacing: 0.5px;
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<!-- 登录回跳中转:仅做 code 转发,画面保持白底 + 居中 loading -->
|
||
<div class="loading-wrap">
|
||
<img class="loading-gif" src="/loading.gif" alt="登录中,请稍后…" />
|
||
<p class="loading-text">登录中,请稍后…</p>
|
||
</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>
|