| 123456789101112131415161718192021222324252627282930313233343536373839 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>登录中...</title>
- </head>
- <body>
- <div style="display:flex;align-items:center;justify-content:center;height:100vh;font-family:sans-serif;color:#666">
- 正在跳转登录页...
- </div>
- <script>
- // OAuth 回调中转页:将 URL 参数暂存到 sessionStorage,然后跳转到 SPA 根路径
- // 用于解决 history 路由模式下 nginx 无 SPA fallback 导致的 404 问题
- (function () {
- var search = window.location.search || '';
- var hash = window.location.hash || '';
- // 合并 query 和 hash 中的参数(兼容 form_post 可能的传递方式)
- var queryString = search.replace(/^\?/, '');
- if (hash && hash.indexOf('?') !== -1) {
- var hashQuery = hash.split('?')[1] || '';
- if (hashQuery) {
- queryString = queryString ? (queryString + '&' + hashQuery) : hashQuery;
- }
- }
- if (queryString) {
- try {
- sessionStorage.setItem('oauth_callback_params', queryString);
- } catch (e) {
- // sessionStorage 不可用时忽略,后续登录页会走正常流程
- }
- }
- // 跳转到 SPA 根路径,确保能加载到 index.html
- window.location.replace(window.location.origin + '/');
- })();
- </script>
- </body>
- </html>
|