From f701ca57d1c6f6d72baf2e26306c601c52f3f47d Mon Sep 17 00:00:00 2001 From: Charles7c Date: Sat, 27 Apr 2024 20:28:21 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=AE=8C=E5=96=84=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E8=B4=A6=E5=8F=B7=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.ts | 1 - src/router/permission.ts | 2 +- src/views/login/index.vue | 19 ++++++----- src/views/login/social/index.vue | 56 +++++++++++++++++++++++--------- 4 files changed, 52 insertions(+), 26 deletions(-) diff --git a/src/router/index.ts b/src/router/index.ts index d8d4d1d..609c6dd 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -48,7 +48,6 @@ export const constantRoutes: RouteRecordRaw[] = [ }, { path: '/social/callback', - name: 'SocialCallback', component: () => import('@/views/login/social/index.vue'), meta: { hidden: true } }, diff --git a/src/router/permission.ts b/src/router/permission.ts index c5fe30c..18d45ab 100644 --- a/src/router/permission.ts +++ b/src/router/permission.ts @@ -4,7 +4,7 @@ import { getToken } from '@/utils/auth' import { isHttp } from '@/utils/validate' /** 免登录白名单 */ -const whiteList = ['/login', '/register'] +const whiteList = ['/login', '/social/callback'] /** 是否已经生成过路由表 */ let hasRouteFlag = false diff --git a/src/views/login/index.vue b/src/views/login/index.vue index b1d7be1..2281420 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -41,14 +41,14 @@ - - - - + + + + @@ -59,9 +59,11 @@ import AccountLogin from './components/account/index.vue' import PhoneLogin from './components/phone/index.vue' import EmailLogin from './components/email/index.vue' import { useAppStore } from '@/stores' +import { useDevice } from '@/hooks' defineOptions({ name: 'Login' }) +const { isDesktop } = useDevice() const appStore = useAppStore() const title = computed(() => appStore.getTitle()) const logo = computed(() => appStore.getLogo()) @@ -83,6 +85,7 @@ const onOauth = async (source: string) => { .login { height: 100%; display: flex; + flex-direction: column; justify-content: center; align-items: center; background-color: var(--color-bg-5); @@ -240,11 +243,11 @@ const onOauth = async (source: string) => { .footer { align-items: center; box-sizing: border-box; - display: flex; - justify-content: center; + position: absolute; + bottom: 10px; + z-index: 999; .beian { .text { - color: #41464f; font-size: 12px; font-weight: 400; letter-spacing: 0.2px; diff --git a/src/views/login/social/index.vue b/src/views/login/social/index.vue index 38ba569..b53d48c 100644 --- a/src/views/login/social/index.vue +++ b/src/views/login/social/index.vue @@ -3,30 +3,58 @@
+ - -