菜单布局

This commit is contained in:
yumaojun03 2025-01-12 10:14:32 +08:00
parent 05fbe8187e
commit daa0aa8b77
5 changed files with 58 additions and 13 deletions

View File

@ -198,3 +198,7 @@
{"level":"debug","time":"2025-01-05T17:03:38+08:00","caller":"token/api/api.go:57","message":"cookie domain: 127.0.0.1"}
{"level":"debug","time":"2025-01-05T17:05:11+08:00","caller":"token/api/api.go:57","message":"cookie domain: 127.0.0.1"}
{"level":"debug","time":"2025-01-05T17:12:56+08:00","caller":"token/api/api.go:57","message":"cookie domain: 127.0.0.1"}
{"level":"info","component":"server","time":"2025-01-11T18:01:07+08:00","caller":"ioc/server/server.go:101","message":"receive signal 'hangup', start graceful shutdown"}
{"level":"info","component":"http","time":"2025-01-11T18:01:07+08:00","caller":"config/http/http.go:152","message":"start graceful shutdown"}
{"level":"error","component":"http","time":"2025-01-11T18:01:07+08:00","caller":"config/http/http.go:146","message":"http: Server closed"}
{"level":"info","component":"server","time":"2025-01-11T18:01:07+08:00","caller":"ioc/server/server.go:115","message":"http service stop complete"}

View File

@ -15,11 +15,10 @@ client.interceptors.response.use(
},
// 请求失败
(error) => {
let msg = error.message
try {
msg = error.response.data.message
} catch (error) {
console.log(error)
let msg = error.message
if (error.response.data && error.response.data.message) {
msg = error.response.data.message
}
Message.error(msg)
},

View File

@ -26,12 +26,36 @@ const router = createRouter({
path: '/backend',
name: 'backend',
component: () => import('../views/backend/BackendLayout.vue'),
redirect: '/backend/blog',
children: [
{
path: 'blog',
name: 'blog_management',
redirect: '/backend/blog/list',
children: [
{
path: 'list',
name: 'backend_blog_list',
component: () => import('../views/backend/blog/ListPage.vue'),
},
{
path: 'tag_list',
name: 'backend_tag_list',
component: () => import('../views/backend/tag/ListPage.vue'),
},
],
},
{
path: 'comment',
name: 'comment_management',
children: [
{
path: 'list',
name: 'backend_comment_list',
component: () => import('../views/backend/blog/ListPage.vue'),
},
],
},
],
},
],

View File

@ -7,24 +7,23 @@
<a-layout class="body">
<!-- 侧边栏 -->
<a-layout-sider :width="260">
<a-menu>
<a-sub-menu key="1">
<a-menu @menu-item-click="handleMenuItemClick">
<a-sub-menu key="blog">
<template #title>
<span>
<IconCalendar />Navigation 1
<icon-bookmark />文章管理
</span>
</template>
<a-menu-item key="1_1">Menu 1</a-menu-item>
<a-menu-item key="1_2">Menu 2</a-menu-item>
<a-menu-item key="backend_blog_list">文章管理</a-menu-item>
<a-menu-item key="backend_tag_list">标签管理</a-menu-item>
</a-sub-menu>
<a-sub-menu key="2">
<template #title>
<span>
<IconCalendar />Navigation 2
<icon-wechat />评论管理
</span>
</template>
<a-menu-item key="2_1">Menu 2.1</a-menu-item>
<a-menu-item key="2_2">Menu 2.2</a-menu-item>
<a-menu-item key="backend_comment_list">评论列表</a-menu-item>
</a-sub-menu>
</a-menu>
</a-layout-sider>
@ -38,6 +37,14 @@
<script setup>
import { useRouter } from 'vue-router';
const router = useRouter()
const handleMenuItemClick = (key) => {
router.push({ name: key })
}
</script>
<style lang="css" scoped>

View File

@ -0,0 +1,11 @@
<template>
<div>
标签列表页面
</div>
</template>
<script setup>
</script>
<style lang="css" scoped></style>