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 */