| 12345678910111213141516171819202122232425262728293031323334353637 |
- <!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 参数带到登录页 hash 路由中
- // 用于解决 history 路由模式下 nginx 无 SPA fallback 导致的 404 问题
- // 同时兼容 hash 路由模式:参数放在 #/login? 后面
- (function () {
- var search = window.location.search || '';
- var hash = window.location.hash || '';
- // 合并 query 和 hash 中的参数
- var queryString = search.replace(/^\?/, '');
- if (hash && hash.indexOf('?') !== -1) {
- var hashQuery = hash.split('?')[1] || '';
- if (hashQuery) {
- queryString = queryString ? (queryString + '&' + hashQuery) : hashQuery;
- }
- }
- // 跳转到登录页,参数放在 hash 路由后面,兼容 hash 模式
- var target = window.location.origin + '/#/login';
- if (queryString) {
- target += '?' + queryString;
- }
- window.location.replace(target);
- })();
- </script>
- </body>
- </html>
|