From b4fa08c4e2346f5c9e76b659a34deb4c233ace6e Mon Sep 17 00:00:00 2001 From: IGCrystal Date: Thu, 12 Jun 2025 23:26:01 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=8E=88=20perf:=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E7=95=8C=E9=9D=A2=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dashboard/src/components/shared/Logo.vue | 2 +- .../src/scss/components/_VTextField.scss | 63 +++++++ .../views/authentication/auth/LoginPage.vue | 164 ++++++++++++++++-- .../authentication/authForms/AuthLogin.vue | 2 + 4 files changed, 219 insertions(+), 12 deletions(-) diff --git a/dashboard/src/components/shared/Logo.vue b/dashboard/src/components/shared/Logo.vue index 2b77ccefa..6a071d979 100644 --- a/dashboard/src/components/shared/Logo.vue +++ b/dashboard/src/components/shared/Logo.vue @@ -5,7 +5,7 @@ AstrBot Logo
-

{{ title }}

+

{{ title }}

{{ subtitle }}

diff --git a/dashboard/src/scss/components/_VTextField.scss b/dashboard/src/scss/components/_VTextField.scss index c74c9dadc..b9572aa74 100644 --- a/dashboard/src/scss/components/_VTextField.scss +++ b/dashboard/src/scss/components/_VTextField.scss @@ -10,6 +10,69 @@ .v-field__outline { color: rgb(var(--v-theme-inputBorder)); } + +// 亮色主题样式 +.v-theme--PurpleTheme .v-text-field .v-field__outline { + --v-field-border-width: 2px !important; + --v-field-border-opacity: 1 !important; + color: rgba(149, 117, 205, 0.6) !important; + border-color: rgba(149, 117, 205, 0.6) !important; +} + +.v-theme--PurpleTheme .v-text-field:hover .v-field__outline { + --v-field-border-width: 2px !important; + --v-field-border-opacity: 1 !important; + color: rgba(149, 117, 205, 0.6) !important; + border-color: rgba(149, 117, 205, 0.6) !important; +} + +.v-theme--PurpleTheme .v-text-field .v-field--focused .v-field__outline { + --v-field-border-width: 2.5px !important; + --v-field-border-opacity: 1 !important; + color: rgba(149, 117, 205, 0.8) !important; + border-color: rgba(149, 117, 205, 0.8) !important; +} + +// 深色主题样式 +.v-theme--PurpleThemeDark .v-text-field .v-field { + background-color: rgba(255, 255, 255, 0.08) !important; +} + +.v-theme--PurpleThemeDark .v-text-field .v-field__outline { + --v-field-border-width: 2px !important; + --v-field-border-opacity: 1 !important; + color: rgba(255, 255, 255, 0.5) !important; + border-color: rgba(255, 255, 255, 0.5) !important; +} + +.v-theme--PurpleThemeDark .v-text-field:hover .v-field__outline { + --v-field-border-width: 2px !important; + --v-field-border-opacity: 1 !important; + color: rgba(255, 255, 255, 0.7) !important; + border-color: rgba(255, 255, 255, 0.7) !important; +} + +.v-theme--PurpleThemeDark .v-text-field .v-field--focused .v-field__outline { + --v-field-border-width: 2.5px !important; + --v-field-border-opacity: 1 !important; + color: rgb(129, 102, 176) !important; + border-color: rgb(126, 99, 171) !important; +} + +.v-theme--PurpleThemeDark .v-text-field input { + color: #ffffff !important; + font-weight: 500; +} + +.v-theme--PurpleThemeDark .v-text-field .v-field__label { + color: rgba(255, 255, 255, 0.8) !important; +} + +.v-theme--PurpleThemeDark .v-text-field .v-field__prepend-inner .v-icon, +.v-theme--PurpleThemeDark .v-text-field .v-field__append-inner .v-icon { + color: rgba(255, 255, 255, 0.8) !important; +} + .inputWithbg { .v-field--variant-outlined { background-color: rgba(0, 0, 0, 0.025); diff --git a/dashboard/src/views/authentication/auth/LoginPage.vue b/dashboard/src/views/authentication/auth/LoginPage.vue index 63caeda47..2eeb78cc9 100644 --- a/dashboard/src/views/authentication/auth/LoginPage.vue +++ b/dashboard/src/views/authentication/auth/LoginPage.vue @@ -9,6 +9,14 @@ import {useCustomizerStore} from "@/stores/customizer"; const cardVisible = ref(false); const router = useRouter(); const authStore = useAuthStore(); +const customizer = useCustomizerStore(); + +// 主题切换函数 +function toggleTheme() { + customizer.SET_UI_THEME( + customizer.uiTheme === 'PurpleThemeDark' ? 'PurpleTheme' : 'PurpleThemeDark' + ); +} onMounted(() => { // 检查用户是否已登录,如果已登录则重定向 @@ -27,6 +35,25 @@ onMounted(() => {