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:
@@ -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}` : ''); },
|
||||
|
||||
|
||||
Reference in New Issue
Block a user