From 19322ac91dc97082fcd09f9c0c3be66c92c498ab Mon Sep 17 00:00:00 2001 From: fangyunong Date: Thu, 3 Jul 2025 20:19:09 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E6=9B=B4=E6=96=B0layout?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.ts | 15 +++ src/views/home/index.vue | 8 ++ src/views/layout/components/LayoutHeader.vue | 125 ++++++++++++++++++ src/views/layout/components/LayoutNav.vue | 99 ++++++++++++++ src/views/layout/index.vue | 131 +++---------------- src/views/login/index.vue | 6 +- src/views/role/pages/Auth.vue | 8 ++ 7 files changed, 271 insertions(+), 121 deletions(-) create mode 100644 src/views/home/index.vue create mode 100644 src/views/layout/components/LayoutHeader.vue create mode 100644 src/views/layout/components/LayoutNav.vue create mode 100644 src/views/role/pages/Auth.vue diff --git a/src/router/index.ts b/src/router/index.ts index 625cbd2..a13814c 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -2,6 +2,8 @@ import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router"; import Login from "@/views/login/index.vue"; //登录组件 import Layout from "@/views/layout/index.vue"; //首页布局 import CallBack from "@/views/login/OauthCallBack.vue"; //反馈页面 +import Home from '@/views/home/index.vue'; //家 +import Auth from '@/views/role/pages/Auth.vue'; //权限管理 const routes: Array = [ { @@ -18,6 +20,19 @@ const routes: Array = [ path: "/layout", name: "Layout", component: Layout, + children:[ + { + path:'', + name:'home', + component:Home, + }, + // 后续用动态菜单 + { + path:'role', + name:'roleAuth', + component:Auth + } + ] }, ]; diff --git a/src/views/home/index.vue b/src/views/home/index.vue new file mode 100644 index 0000000..ea74d7c --- /dev/null +++ b/src/views/home/index.vue @@ -0,0 +1,8 @@ + + + + \ No newline at end of file diff --git a/src/views/layout/components/LayoutHeader.vue b/src/views/layout/components/LayoutHeader.vue new file mode 100644 index 0000000..24db979 --- /dev/null +++ b/src/views/layout/components/LayoutHeader.vue @@ -0,0 +1,125 @@ + + + + \ No newline at end of file diff --git a/src/views/layout/components/LayoutNav.vue b/src/views/layout/components/LayoutNav.vue new file mode 100644 index 0000000..ea3d308 --- /dev/null +++ b/src/views/layout/components/LayoutNav.vue @@ -0,0 +1,99 @@ + + + + \ No newline at end of file diff --git a/src/views/layout/index.vue b/src/views/layout/index.vue index e8cff13..a887347 100644 --- a/src/views/layout/index.vue +++ b/src/views/layout/index.vue @@ -1,10 +1,12 @@ + \ No newline at end of file diff --git a/src/views/login/index.vue b/src/views/login/index.vue index ea8edc7..6136b41 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -211,14 +211,10 @@ const handleDemo = () => { console.log('观看演示'); } -const { loginWithRedirect, logout } = useAuth0(); +const { loginWithRedirect } = useAuth0(); const handleLogin = () => { loginWithRedirect(); } -// 登出 -const handleLogout = () => { - logout({ logoutParams: { returnTo: window.location.origin } }); -} // 联系我们 const handleContact = () => { dialog.warning({ diff --git a/src/views/role/pages/Auth.vue b/src/views/role/pages/Auth.vue new file mode 100644 index 0000000..65a85b5 --- /dev/null +++ b/src/views/role/pages/Auth.vue @@ -0,0 +1,8 @@ + + + + \ No newline at end of file