(function(){try{var p=localStorage.getItem('wealthos_theme')||'light';var t=p;if(p==='auto'){var h=new Date().getHours();t=(h>=7&&h<19)?'light':'dark';}if(t!=='dark')t='light';document.documentElement.setAttribute('data-theme',t);document.documentElement.setAttribute('data-theme-mode',p);var m=document.querySelector('meta[name="theme-color"]');if(m)m.setAttribute('content',t==='dark'?'#16181d':'#e7e8e6');}catch(e){document.documentElement.setAttribute('data-theme','light');document.documentElement.setAttribute('data-theme-mode','light');}})(); WealthOS - 登录

WealthOS

欢迎回来

全资产投资管理平台

忘记密码?请联系管理员重置
专注 · 稳健 · 长期 —— WealthOS
if (new URLSearchParams(location.search).has('error')) { document.getElementById('error').style.display = 'block'; document.querySelector('.login-card').classList.add('shake'); } // 时段问候 (function () { var h = new Date().getHours(), g; if (h >= 5 && h < 11) g = '早上好,新的一天从清晰开始'; else if (h >= 11 && h < 13) g = '中午好,稍作休整'; else if (h >= 13 && h < 18) g = '下午好,保持专注'; else if (h >= 18 && h < 23) g = '晚上好,辛苦了'; else g = '夜深了,注意休息'; document.getElementById('greeting').textContent = g; })(); // 记住上次登录用户名;有记录则聚焦密码 (function () { var user = document.getElementById('username'); try { var last = localStorage.getItem('wealthos_last_user'); if (last) { user.value = last; user.removeAttribute('autofocus'); document.getElementById('password').focus(); } } catch (e) {} })(); // 密码可见性切换 document.getElementById('pwdToggle').addEventListener('click', function () { var pwd = document.getElementById('password'), on = pwd.type === 'password'; pwd.type = on ? 'text' : 'password'; this.setAttribute('aria-pressed', on ? 'true' : 'false'); this.setAttribute('aria-label', on ? '隐藏密码' : '显示密码'); this.setAttribute('title', on ? '隐藏密码' : '显示密码'); this.querySelector('.ico-eye').hidden = on; this.querySelector('.ico-eye-off').hidden = !on; pwd.focus(); }); document.getElementById('loginForm').addEventListener('submit', function (e) { var btn = document.getElementById('loginBtn'); if (btn.classList.contains('is-loading')) { e.preventDefault(); return; } try { localStorage.setItem('wealthos_last_user', document.getElementById('username').value); } catch (er) {} try { sessionStorage.setItem('wealthos_enter', '1'); } catch (er) {} // 登录后一次性入场动画 // 统一走「卡片离场 + 过渡场景淡入」,不再依赖跨文档 View Transition // (新版 Chrome 曾出现 root 快照卡住 → 整页空白;见 base.css 说明) btn.classList.add('is-loading'); btn.querySelector('.btn-label').textContent = '登录中…'; var reduce = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches; if (reduce) return; // 减动效:直接提交,无换场 e.preventDefault(); var form = this; var gt = document.getElementById('greeting').textContent; document.getElementById('ltText').textContent = gt || '欢迎回来,正在进入系统…'; document.body.classList.add('leaving'); // 卡片离场 + 过渡场景淡入 setTimeout(function () { HTMLFormElement.prototype.submit.call(form); }, 780); }); // 主题切换逻辑见 static/js/theme_seg.js(与侧栏共用同一实现)