style:新增登录界面 完善api请求逻辑

This commit is contained in:
liangdong
2025-12-30 21:07:45 +08:00
parent 1cc15fc76d
commit bd2a300f55
9 changed files with 409 additions and 253 deletions

View File

@@ -49,6 +49,7 @@ defineOptions({
});
const userStore = useUserStore();
const router = useRouter();
// 响应式断点(小屏阈值,小于此值视为小屏)
const BREAKPOINT = 1024;
@@ -158,7 +159,16 @@ const handleSideMenuSelect = (menuPath: string) => {
// 初始化:默认选中第一个菜单
onMounted(() => {
if (topLevelMenuList.value.length > 0) {
const currentRoutePath = router.currentRoute.value.path;
const matchedTopMenu = topLevelMenuList.value.find(menu =>
currentRoutePath.startsWith(`${menu.path}/`) || currentRoutePath === menu.path
);
if (matchedTopMenu && matchedTopMenu.path) {
selectedTopMenu.value = matchedTopMenu.path;
} else if (topLevelMenuList.value.length > 0) {
// 否则默认选中第一个菜单
const firstMenu = topLevelMenuList.value[0];
if (firstMenu && firstMenu.path) {
selectedTopMenu.value = firstMenu.path;