diff --git a/.data/content/contents.sqlite b/.data/content/contents.sqlite index 931110e..04b9bb3 100644 Binary files a/.data/content/contents.sqlite and b/.data/content/contents.sqlite differ diff --git a/.gitignore b/.gitignore index 5e791aa..9e2f553 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /.nuxt/ +/node_modules/ diff --git a/.idea/UniappTool.xml b/.idea/UniappTool.xml new file mode 100644 index 0000000..f7328e8 --- /dev/null +++ b/.idea/UniappTool.xml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..9ae2fa3 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,125 @@ + + + + \ No newline at end of file diff --git a/app/components/PortalFooter.vue b/app/components/PortalFooter.vue new file mode 100644 index 0000000..12381f4 --- /dev/null +++ b/app/components/PortalFooter.vue @@ -0,0 +1,76 @@ + + + diff --git a/app/components/PortalHeader.vue b/app/components/PortalHeader.vue new file mode 100644 index 0000000..98bf2cb --- /dev/null +++ b/app/components/PortalHeader.vue @@ -0,0 +1,355 @@ + + + + + diff --git a/app/components/SiteHeader.vue b/app/components/SiteHeader.vue index 9f36d33..341b63d 100644 --- a/app/components/SiteHeader.vue +++ b/app/components/SiteHeader.vue @@ -29,7 +29,7 @@ {{ sub.label }} - + {{ item.label }} {{ item.badge }} @@ -94,7 +94,7 @@ {{ sub.label }} - + {{ item.label }} {{ item.badge }} @@ -120,7 +120,6 @@ import type { User } from '@/api/system/user/model' import { getToken, removeToken } from '@/utils/token-util' import { clearAuthz, setAuthzFromUser } from '@/utils/permission' import { UserOutlined, ProfileOutlined, MessageOutlined } from '@ant-design/icons-vue' -import { message } from 'ant-design-vue' const nav = computed(() => mainNav) @@ -128,18 +127,18 @@ const route = useRoute() const open = ref(false) const selectedKeys = computed(() => { - const hit = nav.value.find((n) => n.to === route.path) - if (hit) return [hit.to] - if (route.path.startsWith('/news')) return ['/news'] - if (route.path.startsWith('/consultation')) return ['/consultation'] - if (route.path.startsWith('/reference')) return ['/reference'] - if (route.path.startsWith('/expert')) return ['/expert'] - if (route.path.startsWith('/think-tank')) return ['/think-tank'] - if (route.path.startsWith('/suggestions')) return ['/suggestions'] - if (route.path.startsWith('/membership')) return ['/membership'] - if (route.path.startsWith('/hanmo')) return ['/hanmo'] - if (route.path.startsWith('/about')) return ['/about'] - return ['/'] + const currentPath = route.path + + const exactHit = nav.value.find((item) => item.to === currentPath) + if (exactHit) return [exactHit.key] + + const prefixHit = nav.value.find((item) => item.to !== '/' && currentPath.startsWith(`${item.to}/`)) + if (prefixHit) return [prefixHit.key] + + const sectionHit = nav.value.find((item) => item.to !== '/' && currentPath.startsWith(item.to)) + if (sectionHit) return [sectionHit.key] + + return ['home'] }) // 获取 badge 样式类 @@ -154,8 +153,6 @@ function getBadgeClass(badge: string) { return `${baseClass} bg-gray-500 text-white` } -const siteName = ref('广西决策咨询网') - const token = ref('') const user = ref(null) const isAuthed = computed(() => !!token.value) @@ -195,12 +192,6 @@ async function refreshAuth() { } } -function goConsoleCenter() { - if (!isAuthed.value) return navigateTo('/login') - open.value = false - navigateTo('/profile') -} - function logout() { removeToken() try { @@ -238,8 +229,9 @@ onUnmounted(() => { diff --git a/app/pages/article/[id].vue b/app/pages/article/[id].vue index 878cf44..02e7afc 100644 --- a/app/pages/article/[id].vue +++ b/app/pages/article/[id].vue @@ -1,23 +1,25 @@