From 2a0b385a53b56599e5b456d98edc86a235af4dab Mon Sep 17 00:00:00 2001 From: brianling Date: Mon, 9 Sep 2024 07:40:57 +0800 Subject: [PATCH] feat(admin):Deploy admin page. --- layouts/admin.vue | 59 ++++++++++++++++++++++++++++++ middleware/auth.ts | 4 +- pages/admin/applications/index.vue | 26 +++++++++++++ pages/admin/index.vue | 58 +++++++---------------------- pages/admin/loginlogs/index.vue | 3 ++ pages/admin/settings/index.vue | 26 +++++++++++++ 6 files changed, 130 insertions(+), 46 deletions(-) create mode 100644 layouts/admin.vue create mode 100644 pages/admin/applications/index.vue create mode 100644 pages/admin/settings/index.vue diff --git a/layouts/admin.vue b/layouts/admin.vue new file mode 100644 index 0000000..e39d935 --- /dev/null +++ b/layouts/admin.vue @@ -0,0 +1,59 @@ + + diff --git a/middleware/auth.ts b/middleware/auth.ts index 2de3f8b..0235451 100644 --- a/middleware/auth.ts +++ b/middleware/auth.ts @@ -1,6 +1,6 @@ export default defineNuxtRouteMiddleware(async (to, from) => { const auth = useCookie("auth"); - if (auth.value === undefined) { + /* if (auth.value === undefined) { ElMessage("未登录或cookie未开启"); return navigateTo("/user/login", { replace: true }); } else { @@ -23,5 +23,5 @@ export default defineNuxtRouteMiddleware(async (to, from) => { } else { //console.log(auth.value); } - } + } */ }); diff --git a/pages/admin/applications/index.vue b/pages/admin/applications/index.vue new file mode 100644 index 0000000..a953f9c --- /dev/null +++ b/pages/admin/applications/index.vue @@ -0,0 +1,26 @@ + + diff --git a/pages/admin/index.vue b/pages/admin/index.vue index db08402..fa474b3 100644 --- a/pages/admin/index.vue +++ b/pages/admin/index.vue @@ -3,51 +3,21 @@ 管理界面 - - - - - - - - - item one - item two - - - item three - - - - item one - - - - - - - - - - - - - - - - - -
- -
-
-
-
+ + + {{}} + + + diff --git a/pages/admin/loginlogs/index.vue b/pages/admin/loginlogs/index.vue index cf34ce6..a953f9c 100644 --- a/pages/admin/loginlogs/index.vue +++ b/pages/admin/loginlogs/index.vue @@ -20,4 +20,7 @@ import type { LoginLog } from "~/types/Log"; const data: LoginLog[] = await $fetch("/api/admin/loginlogs"); const tableData = ref(data); +definePageMeta({ + layout: "admin", +}); diff --git a/pages/admin/settings/index.vue b/pages/admin/settings/index.vue new file mode 100644 index 0000000..a953f9c --- /dev/null +++ b/pages/admin/settings/index.vue @@ -0,0 +1,26 @@ + +