From 1fedf7094cef0ad4d898b77cdc50bb93cadbb430 Mon Sep 17 00:00:00 2001 From: xiaomai Date: Thu, 9 Oct 2025 09:22:21 +0800 Subject: [PATCH] refactor(admin): simplify entry route to point to dashboard The `/admin` route now directly serves the dashboard page by adding an alias, removing the need for a separate login page at that path. - Deletes `pages/admin/index.vue` and the `admin-login` layout. - Aliases `/admin` to `/admin/dashboard` for a more direct entry point. - Improves the default layout with a sticky footer. - Updates VSCode settings for better Tailwind CSS IntelliSense. --- .vscode/settings.json | 29 ++++++++++++++++----- app/composables/useDashboardSidebarLinks.ts | 16 +++++++----- app/layouts/admin-login.vue | 13 --------- app/layouts/default.vue | 20 +++++--------- app/pages/admin/dashboard/index.vue | 1 + app/pages/admin/index.vue | 15 ----------- 6 files changed, 39 insertions(+), 55 deletions(-) delete mode 100644 app/layouts/admin-login.vue delete mode 100644 app/pages/admin/index.vue diff --git a/.vscode/settings.json b/.vscode/settings.json index b7a336a..67f26fd 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,8 +1,23 @@ { - "files.associations": { - "*.page-template": "vue", - "*.layout-template": "vue", - "*.vue": "vue", - "*.css": "tailwindcss" - } -} \ No newline at end of file + "files.associations": { + "*.page-template": "vue", + "*.layout-template": "vue", + "*.vue": "vue", + "*.css": "tailwindcss" + }, + "editor.quickSuggestions": { + "other": "on", + "comments": "off", + "strings": "on" + }, + "tailwindCSS.classAttributes": [ + "class", + "className", + "ngClass", + "class:list", + "ui" + ], + "tailwindCSS.experimental.classRegex": [ + ["ui:\\s*{([^)]*)\\s*}", "(?:'|\"|`)([^']*)(?:'|\"|`)"] + ] +} diff --git a/app/composables/useDashboardSidebarLinks.ts b/app/composables/useDashboardSidebarLinks.ts index e0201bf..f3a70dc 100644 --- a/app/composables/useDashboardSidebarLinks.ts +++ b/app/composables/useDashboardSidebarLinks.ts @@ -3,13 +3,6 @@ import type { NavigationMenuItem } from "@nuxt/ui"; export const useDashboardSidebarLinks = () => { const sidebarLinks = [ [ - { - label: "回到主站", - icon: "mdi:home", - type: "link", - to: "/", - target: "_blank" - }, { label: "仪表盘", icon: "mdi:view-dashboard", @@ -50,6 +43,15 @@ export const useDashboardSidebarLinks = () => { // ], // }, ], + [ + { + label: "回到主站", + icon: "mdi:home", + type: "link", + to: "/", + target: "_blank", + }, + ], ] satisfies NavigationMenuItem[][]; return { sidebarLinks }; diff --git a/app/layouts/admin-login.vue b/app/layouts/admin-login.vue deleted file mode 100644 index 960b2a6..0000000 --- a/app/layouts/admin-login.vue +++ /dev/null @@ -1,13 +0,0 @@ - - - - - \ No newline at end of file diff --git a/app/layouts/default.vue b/app/layouts/default.vue index 491a911..85117d5 100644 --- a/app/layouts/default.vue +++ b/app/layouts/default.vue @@ -1,10 +1,10 @@ - - - - \ No newline at end of file diff --git a/app/pages/admin/dashboard/index.vue b/app/pages/admin/dashboard/index.vue index ccf7032..5e16490 100644 --- a/app/pages/admin/dashboard/index.vue +++ b/app/pages/admin/dashboard/index.vue @@ -19,6 +19,7 @@ const pageTitle = "仪表盘" definePageMeta({ layout: "admin-dashboard", title: pageTitle, + alias: ['/admin'] }) useHead({ title: pageTitle diff --git a/app/pages/admin/index.vue b/app/pages/admin/index.vue deleted file mode 100644 index c2cd61e..0000000 --- a/app/pages/admin/index.vue +++ /dev/null @@ -1,15 +0,0 @@ - - - - - \ No newline at end of file