| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
- <link rel="icon" href="/logo.svg" type="image/svg+xml" />
- <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
- <link rel="manifest" href="/manifest.json" />
- <meta name="theme-color" content="#E3AC00" />
- <meta name="apple-mobile-web-app-capable" content="yes" />
- <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
- <meta name="apple-mobile-web-app-title" content="Vitiens" />
- <title>Vitiens</title>
- </head>
- <body>
- <div id="app"></div>
- <script>
- // 在 Vue 加载前处理 Zalo OAuth 回调参数
- // 因为使用 hash 路由,当 Zalo 回调到 /login?code=xxx 时
- // 页面会重定向到 /#/login,导致 query 参数丢失
- // 所以需要在页面加载时立即保存这些参数
- (function() {
- var urlParams = new URLSearchParams(window.location.search);
- var code = urlParams.get('code');
- var state = urlParams.get('state');
- if (code) {
- // 判断是 TikTok 还是 Zalo 回调(TikTok 的 state 以 tiktok_ 开头)
- if (state && state.indexOf('tiktok_') === 0) {
- sessionStorage.setItem('tiktok_oauth_code', code);
- sessionStorage.setItem('tiktok_oauth_state', state);
- console.log('TikTok OAuth code saved:', code);
- } else {
- // 保存 Zalo 回调的 code 到 sessionStorage
- sessionStorage.setItem('zalo_oauth_code', code);
- if (state) {
- sessionStorage.setItem('zalo_oauth_state', state);
- }
- console.log('Zalo OAuth code saved:', code);
- }
- // 重定向到 hash 路由的登录页,去掉 URL 中的参数
- window.location.href = window.location.origin + '/#/login';
- }
- })();
- </script>
- <script type="module" src="/src/main.ts"></script>
- </body>
- </html>
|