From f000d0aa3fbed0c06a5b466ddb7cd6cbd20224c7 Mon Sep 17 00:00:00 2001 From: XinWei <2718030729@qq.com> Date: Wed, 17 Jul 2024 15:54:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E7=82=B9=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/zh-CN.ts | 2 +- src/router/modules/remaining.ts | 2 +- src/utils/auth.ts | 2 + src/views/Home/Index.vue | 7 +- src/views/Login/components/SSOLoginCustom.vue | 200 ++++++++++++++++++ 5 files changed, 210 insertions(+), 3 deletions(-) create mode 100644 src/views/Login/components/SSOLoginCustom.vue diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 0721651d..c0e306d2 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -113,7 +113,7 @@ export default { small: '小' }, login: { - welcome: '欢迎使用本系统', + welcome: '登录中心', message: '开箱即用的中后台管理系统', tenantname: '租户名称', username: '用户名', diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index bc62a3c4..989bed96 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -186,7 +186,7 @@ const remainingRouter: AppRouteRecordRaw[] = [ }, { path: '/sso', - component: () => import('@/views/Login/Login.vue'), + component: () => import('@/views/Login/components/SSOLoginCustom.vue'), name: 'SSOLogin', meta: { hidden: true, diff --git a/src/utils/auth.ts b/src/utils/auth.ts index c68a67a9..b4ef4efe 100644 --- a/src/utils/auth.ts +++ b/src/utils/auth.ts @@ -20,12 +20,14 @@ export const getRefreshToken = () => { // 设置token export const setToken = (token: TokenType) => { + document.cookie = "LUNDU_LOGIN=true; max-age=1800; path=/"; // 设置cookie登录状态 wsCache.set(RefreshTokenKey, token.refreshToken) wsCache.set(AccessTokenKey, token.accessToken) } // 删除token export const removeToken = () => { + document.cookie = "LUNDU_LOGIN=false; max-age=0; path=/"; // 清除cookie登录状态 wsCache.delete(AccessTokenKey) wsCache.delete(RefreshTokenKey) } diff --git a/src/views/Home/Index.vue b/src/views/Home/Index.vue index f8af569f..58be0b82 100644 --- a/src/views/Home/Index.vue +++ b/src/views/Home/Index.vue @@ -55,7 +55,9 @@ - +