feat: home page logout stays + wider PC layout

- logout() on home/root page: Auth.reset() only (clear state, refresh
  top bar), no redirect to login; other pages still go to login
- home page container: width:min(50vw+300px, 1440px, 96vw) replaces
  fixed max-width:800px - PC wide screens use at least half viewport,
  mobile near full width
This commit is contained in:
2026-08-22 02:47:26 +08:00
parent effc262382
commit 6c05a13ae4
2 changed files with 12 additions and 2 deletions

View File

@@ -83,7 +83,16 @@ const App = {
},
afterLogin() { location.hash = '#/dashboard'; },
logout() { Auth.logout(); },
logout() {
// 首页/根路径为公开页: 退出仅清除登录态, 停留当前页刷新顶栏; 其他页面才回登录页
const page = (location.hash || '#/home').replace('#/', '').split('/')[0];
if (page === 'home' || page === '') {
Auth.reset();
this.updateTopAuth();
} else {
Auth.logout();
}
},
closeModal() { document.getElementById('modal-overlay').classList.add('hidden'); },
navigate(page, param) { location.hash = `#/${page}` + (param ? `/${param}` : ''); },