From 7f2a9c1b4bc4b1ae4bf7b3640e91a12b10f91ea2 Mon Sep 17 00:00:00 2001 From: niyyzf Date: Thu, 25 Jul 2024 17:51:02 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=B7=AF=E7=94=B1=E5=AE=88?= =?UTF-8?q?=E5=8D=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vueapp.client/src/main.ts | 17 +++++++++++++++++ vueapp.client/src/pages/Welcome.vue | 14 +++++++------- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/vueapp.client/src/main.ts b/vueapp.client/src/main.ts index 70ac084..4c26e19 100644 --- a/vueapp.client/src/main.ts +++ b/vueapp.client/src/main.ts @@ -17,6 +17,23 @@ const router = createRouter({ history: createWebHistory(), routes, }) + +router.beforeEach( (to, from, next) => { + const isLogin=false + //如果登录 + if (!isLogin) { + if (to.path === '/welcome') { + next() + } else { + next('/welcome') + } + } + else { + next() + } + next() + +}) const app = createApp(App) app.use(router) app.mount('#app') diff --git a/vueapp.client/src/pages/Welcome.vue b/vueapp.client/src/pages/Welcome.vue index 0393a78..aeb5e54 100644 --- a/vueapp.client/src/pages/Welcome.vue +++ b/vueapp.client/src/pages/Welcome.vue @@ -22,10 +22,10 @@ justify-content: space-between; align-items: center; height: 100vh; - padding: 45px 15px; + padding: 12vw 4vw; button{ display: flex; - padding: 15px 40px; + padding: 4vw 10.67vw; justify-content: center; align-items: center; border-radius: 10px; @@ -34,7 +34,7 @@ min-width: 80%; box-shadow: 1px 2px 6px 0 rgba(0, 110, 233, 0.10); color: #FFF; - font-size: 14px; + font-size: 3.73vw; font-style: normal; font-weight: 400; line-height: 140%; /* 19.6px */ @@ -46,11 +46,11 @@ align-items: center; justify-content: center; text-align: center; - gap: 24px; + gap: 6.4vw; flex: 1; h1{ color: #000; - font-size: 16px; + font-size: 4.27vw; font-style: normal; font-weight: 600; line-height: 140%; /* 22.4px */ @@ -58,8 +58,8 @@ h3{ color: #4A4646; text-align: center; - width: 301px; - font-size: 14px; + width: 80.27vw; + font-size: 3.73vw; font-style: normal; font-weight: 400; line-height: 140%; /* 19.6px */