diff --git a/portal-ui/src/layout/components/User.vue b/portal-ui/src/layout/components/User.vue index 4ee2a11..d803106 100644 --- a/portal-ui/src/layout/components/User.vue +++ b/portal-ui/src/layout/components/User.vue @@ -24,11 +24,8 @@ :title="$t('common.myAccount')"> - - - + + + @@ -64,12 +58,8 @@ @@ -49,6 +84,10 @@ export default { overflow: hidden; background: #0f0f12; + .sidebar-backdrop { + display: none; + } + .fixed-header { z-index: 100; .navbar { @@ -59,6 +98,18 @@ export default { .main-wrapper { display: flex; height: calc(100% - 60px); + position: relative; + } +} + +@media (max-width: 768px) { + .app-wrapper .sidebar-backdrop { + display: block; + position: fixed; + inset: 60px 0 0 0; + z-index: 99; + background: rgba(0, 0, 0, 0.55); + backdrop-filter: blur(2px); } } diff --git a/portal-ui/src/store/modules/main.js b/portal-ui/src/store/modules/main.js index 6c8eee5..829bc80 100644 --- a/portal-ui/src/store/modules/main.js +++ b/portal-ui/src/store/modules/main.js @@ -16,11 +16,13 @@ const state = { sidebar: { opened: isMobile() ? false : true, withoutAnimation: false, - width: Cookies.get('sidebarWidth') || '230px' + // 左侧导航默认适中宽度(用户若需更窄/宽可本地调小范围会写 cookie) + width: Cookies.get('sidebarWidth') || '268px' }, topMenu: Cookies.get('topMenu'), // 当前语言 - language: Cookies.get('language') || 'en_US', + // 多语言切换已禁用:全站固定繁体中文(zh_HK) + language: 'zh_HK', // 主题 '':亮色 / dark:暗黑 theme: $storage.get('theme') || '', // 系统端 diff --git a/portal-ui/src/utils/base.js b/portal-ui/src/utils/base.js index 85f699f..a78b92a 100644 --- a/portal-ui/src/utils/base.js +++ b/portal-ui/src/utils/base.js @@ -27,9 +27,12 @@ export const isFirefox = (_) => { } } -export const isMobile = _=> { - const userAgent = navigator.userAgent; - const isMobile = /iPad|Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent); - const isSmallScreen = window.innerWidth <= 576; - return isMobile || isSmallScreen; +export const isMobile = (_) => { + const userAgent = navigator.userAgent + const uaMobile = + /iPad|Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test( + userAgent + ) + const isSmallScreen = typeof window !== 'undefined' && window.innerWidth <= 768 + return uaMobile || isSmallScreen }