From 16c919ce02c82b1424b7c8c83c390da4b611db12 Mon Sep 17 00:00:00 2001 From: preschool Date: Thu, 15 Aug 2024 10:08:23 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=8E=88=20perf:=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E5=80=BC=E8=A2=AB=E5=90=8E=E7=BB=AD=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E4=BF=AE=E6=94=B9=E5=AF=BC=E8=87=B4=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Login/SocialLogin.vue | 9 +++++---- src/views/Login/components/LoginForm.vue | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/views/Login/SocialLogin.vue b/src/views/Login/SocialLogin.vue index 00bc9fe5..9f877a95 100644 --- a/src/views/Login/SocialLogin.vue +++ b/src/views/Login/SocialLogin.vue @@ -276,10 +276,11 @@ const handleLogin = async (params) => { const code = route?.query?.code as string const state = route?.query?.state as string + const loginDataLoginForm = { ...loginData.loginForm } const res = await LoginApi.login({ // 账号密码登录 - username: loginData.loginForm.username, - password: loginData.loginForm.password, + username: loginDataLoginForm.username, + password: loginDataLoginForm.password, captchaVerification: params.captchaVerification, // 社交登录 socialCode: code, @@ -294,8 +295,8 @@ const handleLogin = async (params) => { text: '正在加载系统中...', background: 'rgba(0, 0, 0, 0.7)' }) - if (loginData.loginForm.rememberMe) { - authUtil.setLoginForm(loginData.loginForm) + if (loginDataLoginForm.rememberMe) { + authUtil.setLoginForm(loginDataLoginForm) } else { authUtil.removeLoginForm() } diff --git a/src/views/Login/components/LoginForm.vue b/src/views/Login/components/LoginForm.vue index 3dbaff3f..0bdf55c5 100644 --- a/src/views/Login/components/LoginForm.vue +++ b/src/views/Login/components/LoginForm.vue @@ -249,8 +249,9 @@ const handleLogin = async (params) => { if (!data) { return } - loginData.loginForm.captchaVerification = params.captchaVerification - const res = await LoginApi.login(loginData.loginForm) + const loginDataLoginForm = { ...loginData.loginForm } + loginDataLoginForm.captchaVerification = params.captchaVerification + const res = await LoginApi.login(loginDataLoginForm) if (!res) { return } @@ -259,8 +260,8 @@ const handleLogin = async (params) => { text: '正在加载系统中...', background: 'rgba(0, 0, 0, 0.7)' }) - if (loginData.loginForm.rememberMe) { - authUtil.setLoginForm(loginData.loginForm) + if (loginDataLoginForm.rememberMe) { + authUtil.setLoginForm(loginDataLoginForm) } else { authUtil.removeLoginForm() } From bd88d29340267761bcf5da31748fc282f8186f98 Mon Sep 17 00:00:00 2001 From: preschooler Date: Thu, 15 Aug 2024 16:30:47 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E2=9C=A8=20feat:=E6=96=B0=E6=80=8E?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E9=A1=B5=E6=B2=89=E6=B5=B8=E5=BC=8F=E6=95=88?= =?UTF-8?q?=E6=9E=9C=EF=BC=8C=E9=BB=98=E8=AE=A4=E6=9C=AA=E5=BC=80=E5=90=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/Setting/src/Setting.vue | 2 + .../src/components/InterfaceDisplay.vue | 12 +++++ .../components/TagsView/src/TagsView.vue | 52 ++++++++++++++++--- src/locales/zh-CN.ts | 1 + src/store/modules/app.ts | 8 +++ 5 files changed, 69 insertions(+), 6 deletions(-) diff --git a/src/layout/components/Setting/src/Setting.vue b/src/layout/components/Setting/src/Setting.vue index e1908b63..717472ac 100644 --- a/src/layout/components/Setting/src/Setting.vue +++ b/src/layout/components/Setting/src/Setting.vue @@ -126,6 +126,8 @@ const copyConfig = async () => { message: ${appStore.getMessage}, // 标签页 tagsView: ${appStore.getTagsView}, + // 标签页 + tagsViewImmerse: ${appStore.getTagsViewImmerse}, // 标签页图标 getTagsViewIcon: ${appStore.getTagsViewIcon}, // logo diff --git a/src/layout/components/Setting/src/components/InterfaceDisplay.vue b/src/layout/components/Setting/src/components/InterfaceDisplay.vue index ebbbf4bc..3ba5c6b0 100644 --- a/src/layout/components/Setting/src/components/InterfaceDisplay.vue +++ b/src/layout/components/Setting/src/components/InterfaceDisplay.vue @@ -73,6 +73,13 @@ const tagsViewChange = (show: boolean) => { appStore.setTagsView(show) } +// 标签页沉浸 +const tagsViewImmerse = ref(appStore.getTagsViewImmerse) + +const tagsViewImmerseChange = (immerse: boolean) => { + appStore.setTagsViewImmerse(immerse) +} + // 标签页图标 const tagsViewIcon = ref(appStore.getTagsViewIcon) @@ -181,6 +188,11 @@ watch( +
+ {{ t('setting.tagsViewImmerse') }} + +
+
{{ t('setting.tagsViewIcon') }} diff --git a/src/layout/components/TagsView/src/TagsView.vue b/src/layout/components/TagsView/src/TagsView.vue index 01610968..cdd7494d 100644 --- a/src/layout/components/TagsView/src/TagsView.vue +++ b/src/layout/components/TagsView/src/TagsView.vue @@ -33,6 +33,8 @@ const affixTagArr = ref([]) const appStore = useAppStore() +const tagsViewImmerse = computed(() => appStore.getTagsViewImmerse) + const tagsViewIcon = computed(() => appStore.getTagsViewIcon) const isDark = computed(() => appStore.getIsDark) @@ -266,7 +268,7 @@ watch( class="relative w-full flex bg-[#fff] dark:bg-[var(--el-bg-color)]" > @@ -343,6 +345,9 @@ watch( :tag-item="item" :class="[ `${prefixCls}__item`, + tagsViewImmerse ? `${prefixCls}__item--immerse` : '', + tagsViewIcon ? `${prefixCls}__item--icon` : '', + tagsViewImmerse && tagsViewIcon ? `${prefixCls}__item--immerse--icon` : '', item?.meta?.affix ? `${prefixCls}__item--affix` : '', { 'is-active': isActive(item) @@ -354,7 +359,7 @@ watch(
@@ -395,7 +400,7 @@ watch( /> @@ -460,7 +465,7 @@ watch( ]" >