diff --git a/frontend/index.html b/frontend/index.html index 0a57cb9..b3d417a 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -3,10 +3,14 @@ + + + + 言逍导航
- + \ No newline at end of file diff --git a/frontend/public/favicon.svg b/frontend/public/favicon.svg new file mode 100644 index 0000000..356aa47 --- /dev/null +++ b/frontend/public/favicon.svg @@ -0,0 +1,4 @@ + + + Y + diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 6dd241c..72c8513 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,5 +1,16 @@ - + \ No newline at end of file diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index 31dea0e..f0fdbbb 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -1,5 +1,6 @@ import { createRouter, createWebHashHistory } from 'vue-router' import Home from '@/views/Home.vue' +import NotFound from '@/views/NotFound.vue' import AdminLayout from '@/views/admin/AdminLayout.vue' import AdminDashboard from '@/views/admin/Dashboard.vue' import AdminLinks from '@/views/admin/Links.vue' @@ -10,19 +11,21 @@ import AdminLogin from '@/views/admin/Login.vue' const router = createRouter({ history: createWebHashHistory(), routes: [ - { path: '/', name: 'home', component: Home }, - { path: '/admin/login', name: 'login', component: AdminLogin }, + { path: '/', name: 'home', component: Home, meta: { transition: 'fade' } }, + { path: '/admin/login', name: 'login', component: AdminLogin, meta: { transition: 'fade' } }, { path: '/admin', component: AdminLayout, redirect: '/admin/dashboard', + meta: { transition: 'fade' }, children: [ - { path: 'dashboard', name: 'dashboard', component: AdminDashboard }, - { path: 'links', name: 'links', component: AdminLinks }, - { path: 'categories', name: 'categories', component: AdminCategories }, - { path: 'settings', name: 'settings', component: AdminSettings }, + { path: 'dashboard', name: 'dashboard', component: AdminDashboard, meta: { transition: 'slide' } }, + { path: 'links', name: 'links', component: AdminLinks, meta: { transition: 'slide' } }, + { path: 'categories', name: 'categories', component: AdminCategories, meta: { transition: 'slide' } }, + { path: 'settings', name: 'settings', component: AdminSettings, meta: { transition: 'slide' } }, ], }, + { path: '/:pathMatch(.*)*', name: 'not-found', component: NotFound }, ], }) @@ -37,4 +40,4 @@ router.beforeEach((to, _from, next) => { } }) -export default router +export default router \ No newline at end of file diff --git a/frontend/src/views/NotFound.vue b/frontend/src/views/NotFound.vue new file mode 100644 index 0000000..777408e --- /dev/null +++ b/frontend/src/views/NotFound.vue @@ -0,0 +1,31 @@ + + + \ No newline at end of file diff --git a/frontend/src/views/admin/Categories.vue b/frontend/src/views/admin/Categories.vue index 50ebbd6..e092ea8 100644 --- a/frontend/src/views/admin/Categories.vue +++ b/frontend/src/views/admin/Categories.vue @@ -8,7 +8,10 @@ -
+
+ +
+
@@ -50,13 +53,19 @@ import { ElMessage, ElMessageBox } from 'element-plus' import { adminApi } from '@/api' const categories = ref([]) +const loading = ref(true) const dialogVisible = ref(false) const editId = ref(null) const form = ref({ icon: '🔗', name: '', sort: 0 }) const dialogWidth = computed(() => window.innerWidth < 500 ? '92%' : '420px') async function load() { - categories.value = (await adminApi.getCategories()).result.data + loading.value = true + try { + categories.value = (await adminApi.getCategories()).result.data + } finally { + loading.value = false + } } function openDialog(row?: any) { @@ -91,6 +100,7 @@ onMounted(load) .page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; } .page-header h2 { font-size: 20px; font-weight: 600; } .table-wrap { overflow-x: auto; } +.loading-wrap { padding: 20px; } @media (max-width: 767px) { .page-header h2 { font-size: 18px; } diff --git a/frontend/src/views/admin/Links.vue b/frontend/src/views/admin/Links.vue index bd1fcfd..2200dfb 100644 --- a/frontend/src/views/admin/Links.vue +++ b/frontend/src/views/admin/Links.vue @@ -19,12 +19,20 @@ -
+
+ +
+
+ + + - - + +