From 640b1aa99e2b2147741936443d8008a45b88feee Mon Sep 17 00:00:00 2001 From: YGXB_net Date: Thu, 4 Sep 2025 13:08:48 +0800 Subject: [PATCH] =?UTF-8?q?feat(auth):=20=E9=87=8D=E6=9E=84=E6=9D=83?= =?UTF-8?q?=E9=99=90=E7=AE=A1=E7=90=86=E7=B3=BB=E7=BB=9F=E5=92=8C=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/App.vue | 53 +-------------------- web/src/router/index.ts | 27 ++++++++++- web/src/stores/counter.ts | 4 +- web/src/views/AdminView.vue | 50 ++++++++++++++++++++ web/src/views/HomeView.vue | 77 +++++++++++++++++++++++++++++++ web/src/views/TokenDetailView.vue | 51 ++++++++++---------- web/src/views/TokenManageView.vue | 3 +- 7 files changed, 184 insertions(+), 81 deletions(-) create mode 100644 web/src/views/AdminView.vue create mode 100644 web/src/views/HomeView.vue diff --git a/web/src/App.vue b/web/src/App.vue index 8b50d87..19444e6 100644 --- a/web/src/App.vue +++ b/web/src/App.vue @@ -1,64 +1,15 @@ - - - diff --git a/web/src/router/index.ts b/web/src/router/index.ts index 78f33dc..1900874 100644 --- a/web/src/router/index.ts +++ b/web/src/router/index.ts @@ -2,10 +2,33 @@ import {createRouter, createWebHistory} from 'vue-router' import TokenManageView from '@/views/TokenManageView.vue' import TokenDetailView from '@/views/TokenDetailView.vue' +import AdminView from '@/views/AdminView.vue' +import HomeView from '@/views/HomeView.vue' const routes = [ - {path: '/manage', name: "TokenManage", component: TokenManageView}, - {path: '/', name: "TokenDetail", component: TokenDetailView}, + { + path: '/', + name: "Home", + component: HomeView, + }, + { + path: '/admin', + name: "Admin", + component: AdminView, + children: [ + { + path: '', + name: "TokenManage", + component: TokenManageView + }, + { + path: 'token', + name: "TokenDetail", + component: TokenDetailView + }, + ], + }, + ]; const router = createRouter({ diff --git a/web/src/stores/counter.ts b/web/src/stores/counter.ts index 1eb2291..9d20685 100644 --- a/web/src/stores/counter.ts +++ b/web/src/stores/counter.ts @@ -2,11 +2,13 @@ import {ref, computed} from 'vue' import {defineStore} from 'pinia' export const useCounterStore = defineStore('counter', () => { + const homeToken = ref("") + const token = ref("") const isAdmin = ref(false) - + return {token, isAdmin} }, { persist: true diff --git a/web/src/views/AdminView.vue b/web/src/views/AdminView.vue new file mode 100644 index 0000000..1c70962 --- /dev/null +++ b/web/src/views/AdminView.vue @@ -0,0 +1,50 @@ + + + + + diff --git a/web/src/views/HomeView.vue b/web/src/views/HomeView.vue new file mode 100644 index 0000000..e701f74 --- /dev/null +++ b/web/src/views/HomeView.vue @@ -0,0 +1,77 @@ + + + + + + \ No newline at end of file diff --git a/web/src/views/TokenDetailView.vue b/web/src/views/TokenDetailView.vue index 8b1fd13..e54e09a 100644 --- a/web/src/views/TokenDetailView.vue +++ b/web/src/views/TokenDetailView.vue @@ -70,34 +70,35 @@ axios.get('/api/token').then(res => {