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:
17
.vscode/settings.json
vendored
17
.vscode/settings.json
vendored
@@ -4,5 +4,20 @@
|
|||||||
"*.layout-template": "vue",
|
"*.layout-template": "vue",
|
||||||
"*.vue": "vue",
|
"*.vue": "vue",
|
||||||
"*.css": "tailwindcss"
|
"*.css": "tailwindcss"
|
||||||
}
|
},
|
||||||
|
"editor.quickSuggestions": {
|
||||||
|
"other": "on",
|
||||||
|
"comments": "off",
|
||||||
|
"strings": "on"
|
||||||
|
},
|
||||||
|
"tailwindCSS.classAttributes": [
|
||||||
|
"class",
|
||||||
|
"className",
|
||||||
|
"ngClass",
|
||||||
|
"class:list",
|
||||||
|
"ui"
|
||||||
|
],
|
||||||
|
"tailwindCSS.experimental.classRegex": [
|
||||||
|
["ui:\\s*{([^)]*)\\s*}", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
|
||||||
|
]
|
||||||
}
|
}
|
||||||
@@ -3,13 +3,6 @@ import type { NavigationMenuItem } from "@nuxt/ui";
|
|||||||
export const useDashboardSidebarLinks = () => {
|
export const useDashboardSidebarLinks = () => {
|
||||||
const sidebarLinks = [
|
const sidebarLinks = [
|
||||||
[
|
[
|
||||||
{
|
|
||||||
label: "回到主站",
|
|
||||||
icon: "mdi:home",
|
|
||||||
type: "link",
|
|
||||||
to: "/",
|
|
||||||
target: "_blank"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
label: "仪表盘",
|
label: "仪表盘",
|
||||||
icon: "mdi:view-dashboard",
|
icon: "mdi:view-dashboard",
|
||||||
@@ -50,6 +43,15 @@ export const useDashboardSidebarLinks = () => {
|
|||||||
// ],
|
// ],
|
||||||
// },
|
// },
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
{
|
||||||
|
label: "回到主站",
|
||||||
|
icon: "mdi:home",
|
||||||
|
type: "link",
|
||||||
|
to: "/",
|
||||||
|
target: "_blank",
|
||||||
|
},
|
||||||
|
],
|
||||||
] satisfies NavigationMenuItem[][];
|
] satisfies NavigationMenuItem[][];
|
||||||
|
|
||||||
return { sidebarLinks };
|
return { sidebarLinks };
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<slot />
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div class="min-h-screen flex flex-col">
|
||||||
<!-- 导航栏 -->
|
<!-- 导航栏 -->
|
||||||
<header class="bg-white shadow-md sticky top-0 z-50">
|
<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 class="max-w-6xl mx-auto px-4 py-3 flex justify-between items-center">
|
||||||
<div>
|
<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">
|
<h1 class="inline text-xl font-bold text-gray-900">
|
||||||
<a href="/" class="ml-4 hover:text-primary">永平中学校友会</a>
|
<a href="/" class="ml-4 hover:text-primary">永平中学校友会</a>
|
||||||
</h1>
|
</h1>
|
||||||
@@ -19,22 +19,23 @@
|
|||||||
加入
|
加入
|
||||||
<Icon name="mdi:account-plus" class="w-5 h-5" />
|
<Icon name="mdi:account-plus" class="w-5 h-5" />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
<!-- 主体部分 -->
|
||||||
|
<main class="flex-1">
|
||||||
<slot />
|
<slot />
|
||||||
|
</main>
|
||||||
|
|
||||||
<!-- 页脚 -->
|
<!-- 页脚 -->
|
||||||
<footer class="bg-gray-900 text-gray-300 py-6">
|
<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="max-w-6xl mx-auto px-4 flex flex-col md:flex-row justify-between items-center">
|
||||||
<!-- 左侧版权信息 -->
|
|
||||||
<div class="text-center md:text-left">
|
<div class="text-center md:text-left">
|
||||||
<p>© 2025 永平中学校友会. 保留所有权利.</p>
|
<p>© 2025 永平中学校友会. 保留所有权利.</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="">
|
<div>
|
||||||
<p class="mt-1">
|
<p class="mt-1">
|
||||||
Powered by:
|
Powered by:
|
||||||
<a href="https://tootaio.com" target="_blank" class="font-semibold hover:underline" style="color: #e24545;">
|
<a href="https://tootaio.com" target="_blank" class="font-semibold hover:underline" style="color: #e24545;">
|
||||||
@@ -44,7 +45,6 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- 右侧社交链接 -->
|
|
||||||
<div class="flex space-x-4 mt-3 md:mt-0">
|
<div class="flex space-x-4 mt-3 md:mt-0">
|
||||||
<a href="#">
|
<a href="#">
|
||||||
<Icon name="mdi-facebook" />
|
<Icon name="mdi-facebook" />
|
||||||
@@ -60,9 +60,3 @@
|
|||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style></style>
|
|
||||||
@@ -19,6 +19,7 @@ const pageTitle = "仪表盘"
|
|||||||
definePageMeta({
|
definePageMeta({
|
||||||
layout: "admin-dashboard",
|
layout: "admin-dashboard",
|
||||||
title: pageTitle,
|
title: pageTitle,
|
||||||
|
alias: ['/admin']
|
||||||
})
|
})
|
||||||
useHead({
|
useHead({
|
||||||
title: pageTitle
|
title: pageTitle
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
Login Page
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script lang="ts" setup>
|
|
||||||
definePageMeta({
|
|
||||||
layout: "admin-login"
|
|
||||||
})
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
Reference in New Issue
Block a user