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.
This commit is contained in:
xiaomai
2025-10-09 09:22:21 +08:00
parent cc7b2a7398
commit 1fedf7094c
6 changed files with 39 additions and 55 deletions

27
.vscode/settings.json vendored
View File

@@ -1,8 +1,23 @@
{
"files.associations": {
"*.page-template": "vue",
"*.layout-template": "vue",
"*.vue": "vue",
"*.css": "tailwindcss"
}
"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*}", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
]
}

View File

@@ -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 };

View File

@@ -1,13 +0,0 @@
<template>
<div>
<slot />
</div>
</template>
<script lang="ts" setup>
</script>
<style>
</style>

View File

@@ -1,10 +1,10 @@
<template>
<div>
<div class="min-h-screen flex flex-col">
<!-- 导航栏 -->
<header class="bg-white shadow-md sticky top-0 z-50">
<div class="max-w-6xl mx-auto px-4 py-3 flex justify-between items-center">
<div>
<img class="inline w-16" src="/Logo.svg" alt="YPHS Alumni">
<img class="inline w-16" src="/Logo.svg" alt="YPHS Alumni" />
<h1 class="inline text-xl font-bold text-gray-900">
<a href="/" class="ml-4 hover:text-primary">永平中学校友会</a>
</h1>
@@ -19,22 +19,23 @@
加入
<Icon name="mdi:account-plus" class="w-5 h-5" />
</a>
</nav>
</div>
</header>
<slot />
<!-- 主体部分 -->
<main class="flex-1">
<slot />
</main>
<!-- 页脚 -->
<footer class="bg-gray-900 text-gray-300 py-6">
<div class="max-w-6xl mx-auto px-4 flex flex-col md:flex-row justify-between items-center">
<!-- 左侧版权信息 -->
<div class="text-center md:text-left">
<p>© 2025 永平中学校友会. 保留所有权利.</p>
</div>
<div class="">
<div>
<p class="mt-1">
Powered by:
<a href="https://tootaio.com" target="_blank" class="font-semibold hover:underline" style="color: #e24545;">
@@ -44,7 +45,6 @@
</p>
</div>
<!-- 右侧社交链接 -->
<div class="flex space-x-4 mt-3 md:mt-0">
<a href="#">
<Icon name="mdi-facebook" />
@@ -60,9 +60,3 @@
</footer>
</div>
</template>
<script lang="ts" setup>
</script>
<style></style>

View File

@@ -19,6 +19,7 @@ const pageTitle = "仪表盘"
definePageMeta({
layout: "admin-dashboard",
title: pageTitle,
alias: ['/admin']
})
useHead({
title: pageTitle

View File

@@ -1,15 +0,0 @@
<template>
<div>
Login Page
</div>
</template>
<script lang="ts" setup>
definePageMeta({
layout: "admin-login"
})
</script>
<style>
</style>