From 008e168d50c53c5436b8f7398bc6b446f7ac5ee0 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期二, 20 十月 2026 11:34:33 +0800
Subject: [PATCH] fix(auth): 登录页恢复标品布局,主题色还原默认蓝色

---
 src/preferences.ts                       |    4 -
 /dev/null                                |   59 -------------------
 src/views/_core/authentication/login.vue |   32 ----------
 src/layouts/auth.vue                     |   36 ++++++-----
 src/bootstrap.ts                         |    1 
 src/main.ts                              |   31 ++++------
 6 files changed, 33 insertions(+), 130 deletions(-)

diff --git a/src/bootstrap.ts b/src/bootstrap.ts
index 1cb5cca..bbfb549 100644
--- a/src/bootstrap.ts
+++ b/src/bootstrap.ts
@@ -7,7 +7,6 @@
 import { initStores } from './packages/stores/src';
 import './packages/styles/src';
 import './packages/styles/src/antd/index.css';
-import './styles/herbal-theme.css';
 
 import { useTitle } from '@vueuse/core';
 
diff --git a/src/layouts/auth-scene.vue b/src/layouts/auth-scene.vue
deleted file mode 100644
index 1ee0093..0000000
--- a/src/layouts/auth-scene.vue
+++ /dev/null
@@ -1,78 +0,0 @@
-<script setup lang="ts">
-withDefaults(defineProps<{ appName?: string; logo?: string; platformTitle?: string; platformDescription?: string }>(), {
-  appName: '', logo: '', platformTitle: '婊嬭ˉ鍝佽涓氭暟瀛楀寲绠$悊骞冲彴', platformDescription: '浼犳壙涓尰鑽簿鍗� 路 鏈嶅姟鍋ュ悍缇庡ソ鐢熸椿',
-});
-</script>
-<template>
-  <div class="herbal-auth">
-    <img class="herbal-auth__background" src="/images/auth/herbal-courtyard.png" alt="" fetchpriority="high" decoding="async" aria-hidden="true" />
-    <div class="herbal-auth__veil" aria-hidden="true"></div>
-    <header class="herbal-auth__header">
-      <div class="herbal-brand">
-        <img v-if="logo" :src="logo" :alt="appName || '鍏徃鏍囧織'" class="herbal-brand__logo" />
-        <span v-if="appName" class="herbal-brand__name">{{ appName }}</span>
-        <div class="herbal-brand__platform">
-          <p class="herbal-brand__title">{{ platformTitle }}</p>
-          <p class="herbal-brand__description">{{ platformDescription }}</p>
-        </div>
-      </div>
-      <div class="herbal-auth__toolbar"><slot name="toolbar"></slot></div>
-    </header>
-    <main class="herbal-auth__main">
-      <section class="herbal-motto" aria-labelledby="herbal-motto-title">
-        <h2 id="herbal-motto-title"><span></span>鍫傝<span></span></h2>
-        <p>鍝佸懗铏借吹锛屽繀涓嶆暍鍑忕墿鍔�</p>
-        <p>鐐埗铏界箒锛屽繀涓嶆暍鐪佷汉宸�</p>
-        <div class="herbal-motto__rule" aria-hidden="true"><span></span><svg viewBox="0 0 60 24"><path d="M3 12h10c0-6 8-9 12-5 0-7 10-7 10 0 5-4 12-1 12 5h10M13 12c0 8 12 11 17 3 5 8 17 5 17-3M24 12c0-7 12-7 12 0s-12 7-12 0Z" /></svg><span></span></div>
-      </section>
-      <section class="herbal-panel" aria-label="璐︽埛鐧诲綍">
-        <div class="herbal-panel__frame" aria-hidden="true">
-          <svg v-for="corner in ['tl','tr','bl','br']" :key="corner" :class="'herbal-corner herbal-corner--'+corner" viewBox="0 0 44 44"><path d="M2 42V12A10 10 0 0 1 12 2h30M9 42V9h33M2 21h19V2M9 28h19V9M2 35h33V2" /></svg>
-        </div>
-        <div class="herbal-panel__content"><slot></slot></div>
-      </section>
-    </main>
-  </div>
-</template>
-<style scoped>
-.herbal-auth{position:relative;isolation:isolate;min-height:100svh;overflow-x:clip;background:#f6eddf;color:#29251f;padding:clamp(24px,3.2vw,52px) clamp(24px,5vw,88px) 42px;font-family:var(--font-family,system-ui,sans-serif)}
-.herbal-auth__background,.herbal-auth__veil{position:absolute;inset:0;width:100%;height:100%;z-index:-2;object-fit:cover;object-position:center}
-.herbal-auth__veil{z-index:-1;background:linear-gradient(90deg,transparent 48%,rgba(248,239,226,.14))}
-.herbal-auth__header{display:flex;align-items:center;justify-content:space-between;gap:24px;position:relative;z-index:2}
-.herbal-brand{display:flex;align-items:center;gap:18px;min-width:0}
-.herbal-brand__logo{width:70px;height:70px;object-fit:contain;flex-shrink:0}
-.herbal-brand__name{font-family:"STKaiti","KaiTi","FangSong",serif;font-weight:700;font-size:clamp(24px,2.3vw,38px);white-space:nowrap}
-.herbal-brand__platform{border-left:1px solid #8e7e6a;padding-left:24px;min-width:0}
-.herbal-brand__title{font-size:clamp(17px,1.5vw,24px);letter-spacing:.04em;margin:0 0 7px;line-height:1.4}
-.herbal-brand__description{font-size:13px;color:#71685b;letter-spacing:.16em;margin:0;line-height:1.5}
-.herbal-auth__toolbar{flex-shrink:0;position:relative;min-width:80px}
-.herbal-auth__toolbar :deep(>div){position:static!important;background:rgba(255,253,248,.75);border:1px solid #e5d8c5;border-radius:30px;padding:4px 10px}
-.herbal-auth__main{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(400px,.85fr);gap:clamp(36px,5vw,88px);align-items:start;min-height:calc(100svh - 176px);padding-top:34px}
-.herbal-motto{align-self:start;margin-top:12px;padding:0 0 24px;text-align:center}
-.herbal-motto h2{display:flex;align-items:center;justify-content:center;gap:34px;font-family:"STKaiti","KaiTi","FangSong",serif;font-size:clamp(40px,4.3vw,72px);font-weight:700;line-height:1.2;letter-spacing:.2em;color:#8b1419;margin:0 0 12px}
-.herbal-motto h2 span{height:1px;background:#ae7650;width:90px}
-.herbal-motto p{font-family:"STKaiti","KaiTi","FangSong",serif;font-size:clamp(26px,3.15vw,54px);font-weight:700;line-height:1.65;letter-spacing:.015em;color:#863310;margin:0;white-space:nowrap}
-.herbal-motto__rule{display:flex;align-items:center;justify-content:center;gap:22px;margin-top:22px;color:#a46628}
-.herbal-motto__rule span{width:110px;height:1px;background:currentColor}
-.herbal-motto__rule svg{width:55px;height:26px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
-.herbal-panel{position:relative;width:100%;max-width:584px;justify-self:end;min-height:690px;border-radius:20px;background:rgba(255,253,249,.96);box-shadow:0 22px 55px rgba(91,49,19,.13);padding:clamp(76px,12.8vh,120px) clamp(34px,4.6vw,78px) 64px;display:flex;align-items:flex-start}
-.herbal-panel__frame{position:absolute;inset:16px;border:1px solid #cda878;border-radius:12px;pointer-events:none}
-.herbal-corner{position:absolute;width:38px;height:38px;fill:none;stroke:#cda878;stroke-width:1.3;background:#fffdf9}
-.herbal-corner--tl{top:-1px;left:-1px;border-top-left-radius:12px}.herbal-corner--tr{top:-1px;right:-1px;transform:rotate(90deg);border-top-left-radius:12px}.herbal-corner--bl{bottom:-1px;left:-1px;transform:rotate(-90deg);border-top-left-radius:12px}.herbal-corner--br{bottom:-1px;right:-1px;transform:rotate(180deg);border-top-left-radius:12px}
-.herbal-panel__content{width:100%;position:relative;min-width:0}
-:global(.dark .herbal-auth){background:#211b17;color:#f4eadd}
-:global(.dark .herbal-auth__background){filter:brightness(.4) saturate(.7)}
-:global(.dark .herbal-auth__veil){background:rgba(24,19,15,.28)}
-:global(.dark .herbal-brand__description){color:#d4c3ac}
-:global(.dark .herbal-motto h2){color:#f0bab3}
-:global(.dark .herbal-motto p){color:#edcfa5}
-:global(.dark .herbal-panel){background:rgba(39,31,26,.97)}
-:global(.dark .herbal-corner){background:#271f1a}
-:global(.dark .herbal-auth__toolbar >div){background:#30271f;border-color:#8d7053;color:#f4eadd}
-@media(min-width:1800px){.herbal-auth__main{grid-template-columns:minmax(0,1fr) 584px}.herbal-motto{max-width:900px;justify-self:center;width:100%}}
-@media(max-width:1199px){.herbal-auth{padding:28px}.herbal-brand{gap:12px}.herbal-brand__logo{width:52px;height:52px}.herbal-brand__platform{padding-left:16px}.herbal-brand__description{letter-spacing:.06em}.herbal-auth__main{gap:26px;grid-template-columns:minmax(0,1fr) minmax(360px,.9fr)}.herbal-motto p{font-size:clamp(25px,3vw,36px)}.herbal-panel{padding:50px 36px;min-height:600px}}
-@media(max-width:900px){.herbal-auth{padding:24px;}.herbal-brand__name{font-size:24px}.herbal-brand__description{display:none}.herbal-brand__title{font-size:17px}.herbal-auth__main{grid-template-columns:1fr;min-height:calc(100svh - 112px);padding:32px 0;}.herbal-motto{display:none}.herbal-panel{max-width:520px;min-height:560px;justify-self:center}.herbal-auth__background{object-position:35% center}.herbal-auth__veil{background:rgba(248,239,226,.48)}}
-@media(max-width:540px){.herbal-auth{padding:20px 16px 24px}.herbal-auth__header{align-items:flex-start;gap:10px}.herbal-brand{gap:10px;flex-wrap:wrap;max-width:calc(100% - 86px)}.herbal-brand__logo{width:42px;height:42px}.herbal-brand__name{font-size:22px}.herbal-brand__platform{border:0;padding:0;flex-basis:100%}.herbal-brand__title{font-size:14px;letter-spacing:.02em;margin:0}.herbal-auth__toolbar{min-width:76px}.herbal-panel{padding:50px 28px;min-height:510px;border-radius:16px}.herbal-panel__frame{inset:12px}.herbal-auth__main{padding-top:28px}.herbal-corner{width:30px;height:30px}}
-@media(max-height:760px) and (min-width:901px){.herbal-panel{min-height:530px;padding-top:48px;padding-bottom:48px}.herbal-auth__main{padding-top:22px}.herbal-motto{margin-top:20px}}
-</style>
-
diff --git a/src/layouts/auth.vue b/src/layouts/auth.vue
index a1fead3..9bf8bb3 100644
--- a/src/layouts/auth.vue
+++ b/src/layouts/auth.vue
@@ -1,16 +1,15 @@
 <script lang="ts" setup>
 import { computed, onMounted } from 'vue';
 
-import { preferences, usePreferences } from '@vben/preferences';
+import { AuthPageLayout } from '@vben/layouts';
+import { preferences } from '@vben/preferences';
 
+import { $t } from '#/locales';
 import { useCompanyConfigStore } from '#/store/company-config';
-import AuthenticationToolbar from '../packages/effects/layouts/src/authentication/toolbar.vue';
-import AuthScene from './auth-scene.vue';
 
 declare const __APP_LOGO__: string;
 
 const companyConfigStore = useCompanyConfigStore();
-const { isDark } = usePreferences();
 
 onMounted(() => {
   // 鐧诲綍椤靛睍绀� loginTitle锛氬惎鍔ㄥ姞杞借蛋鐨勬槸绾嚱鏁帮紙涓嶅~ store锛夛紝杩涘叆鐧诲綍椤垫椂鎷夊彇涓�娆�
@@ -20,26 +19,29 @@
 const appName = computed(() => preferences.copyright.companyName);
 // 鐧诲綍椤� logo 浼樺厛鍙栨暟鎹簱閰嶇疆锛坧references.logo.source锛夛紝鏈厤缃椂鍥為��缂栬瘧鏈熼粯璁� __APP_LOGO__
 const logo = computed(() => {
-  const source = (isDark.value && preferences.logo.sourceDark) || preferences.logo.source || __APP_LOGO__;
+  const source = preferences.logo.source || __APP_LOGO__;
   // 鏈厤缃叕鍙告爣蹇楁椂涓嶅睍绀烘鏋舵紨绀� Logo銆�
   return source?.includes('@vbenjs/static-source') ? '' : source;
 });
-const pageTitle = computed(() => companyConfigStore.loginTitle || '婊嬭ˉ鍝佽涓氭暟瀛楀寲绠$悊骞冲彴');
-const pageDescription = computed(() => companyConfigStore.loginDescription || '浼犳壙涓尰鑽簿鍗� 路 鏈嶅姟鍋ュ悍缇庡ソ鐢熸椿');
+const logoDark = computed(() => preferences.logo.sourceDark);
+// 鏍囬/鎻忚堪浼樺厛鍙栧叕鍙镐俊鎭厤缃紝鏈厤缃椂鍥為��鏍囧搧鏂囨
+const pageTitle = computed(
+  () => companyConfigStore.loginTitle || $t('authentication.pageTitle'),
+);
+const pageDescription = computed(
+  () => companyConfigStore.loginDescription || $t('authentication.pageDesc'),
+);
 </script>
 
 <template>
-  <AuthScene
+  <AuthPageLayout
     :app-name="appName"
     :logo="logo"
-    :platform-description="pageDescription"
-    :platform-title="pageTitle"
+    :logo-dark="logoDark"
+    :page-description="pageDescription"
+    :page-title="pageTitle"
   >
-    <template #toolbar><AuthenticationToolbar :toolbar-list="['language', 'theme']" /></template>
-    <RouterView v-slot="{ Component, route }">
-      <KeepAlive :include="['Login']">
-        <component :is="Component" :key="route.fullPath" />
-      </KeepAlive>
-    </RouterView>
-  </AuthScene>
+    <!-- 鑷畾涔夊伐鍏锋爮 -->
+    <!-- <template #toolbar></template> -->
+  </AuthPageLayout>
 </template>
diff --git a/src/main.ts b/src/main.ts
index e60e320..78e8f13 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -1,5 +1,4 @@
-import { watch } from 'vue';
-import { initPreferences, preferences, preferencesManager } from './packages/preferences/src';
+import { initPreferences, preferencesManager } from './packages/preferences/src';
 import { unmountGlobalLoading } from './packages/utils/src';
 
 import { overridesPreferences, preferencesExtension } from './preferences';
@@ -25,27 +24,21 @@
     overrides: overridesPreferences,
   });
 
-  // 棣栨鍗囩骇鍚屾鍝佺墝涓昏壊锛岄伩鍏嶆棫鐨勮摑鑹插亸濂介伄鐩栨湰娆′富棰樻洿鏂般��
-  // 鍗囩骇鍚庣敤鎴峰湪鍋忓ソ璁剧疆涓�夋嫨鐨勯鑹插拰鏄庢殫妯″紡浠嶄細淇濈暀銆�
-  document.documentElement.dataset.brandTheme = 'herbal';
-  const brandThemeKey = `${namespace}-herbal-theme-v1`;
+  // 鎭㈠鏍囧搧榛樿钃濊壊涓婚锛氭竻鎺変箣鍓嶇紦瀛樼殑鏈辩爞绾㈠搧鐗岃壊銆�
+  // 涓�娆℃�ц縼绉伙紝涔嬪悗鐢ㄦ埛鍦ㄥ亸濂借缃腑閫夋嫨鐨勯鑹蹭粛浼氫繚鐣欍��
+  const themeMigrationKey = `${namespace}-default-blue-theme-v1`;
+  const defaultTheme = {
+    theme: { builtinType: 'default' as const, colorPrimary: 'hsl(212 100% 45%)' },
+  };
   try {
-    if (!localStorage.getItem(brandThemeKey)) {
-      preferencesManager.updatePreferences({
-        theme: { builtinType: 'custom', colorPrimary: '#a51d24' },
-      });
-      localStorage.setItem(brandThemeKey, '1');
+    if (!localStorage.getItem(themeMigrationKey)) {
+      preferencesManager.updatePreferences(defaultTheme);
+      localStorage.setItem(themeMigrationKey, '1');
+      localStorage.removeItem(`${namespace}-herbal-theme-v1`);
     }
   } catch {
-    preferencesManager.updatePreferences({
-      theme: { builtinType: 'custom', colorPrimary: '#a51d24' },
-    });
+    preferencesManager.updatePreferences(defaultTheme);
   }
-  watch(
-    () => preferences.theme.colorPrimary,
-    (color) => { document.documentElement.dataset.herbalPalette = String(color.toLowerCase() === '#a51d24'); },
-    { immediate: true, flush: 'sync' },
-  );
 
   // 寮哄埗瑕嗙洊鍏徃 logo 鍜� favicon锛岀粫杩� localStorage 缂撳瓨
   if (__APP_LOGO__) {
diff --git a/src/preferences.ts b/src/preferences.ts
index c33de43..4da3a4e 100644
--- a/src/preferences.ts
+++ b/src/preferences.ts
@@ -20,10 +20,6 @@
  */
 export const overridesPreferences = defineOverridesPreferences({
   // overrides
-  theme: {
-    builtinType: 'custom',
-    colorPrimary: '#a51d24',
-  },
   app: {
     /** 鍚庣璺敱妯″紡 */
     accessMode: 'backend',
diff --git a/src/styles/herbal-theme.css b/src/styles/herbal-theme.css
deleted file mode 100644
index 86ddaa2..0000000
--- a/src/styles/herbal-theme.css
+++ /dev/null
@@ -1,59 +0,0 @@
-/* 鍝佺墝涓�ц壊涓庝富鑹插垎绂伙細涓昏壊浠嶉�氳繃 Vben preferences 鐢熸垚鍏ㄩ儴鑹查樁銆� */
-html[data-brand-theme='herbal']:not(.dark) {
-  --background: 40 50% 99%;
-  --background-deep: 37 33% 95%;
-  --foreground: 27 16% 17%;
-  --card: 40 50% 99%;
-  --card-foreground: 27 16% 17%;
-  --popover: 40 50% 99%;
-  --popover-foreground: 27 16% 17%;
-  --muted: 35 25% 94%;
-  --muted-foreground: 28 10% 40%;
-  --secondary: 35 25% 94%;
-  --secondary-foreground: 27 16% 17%;
-  --accent: 33 35% 93%;
-  --accent-dark: 33 28% 90%;
-  --accent-darker: 33 24% 87%;
-  --accent-lighter: 38 45% 97%;
-  --accent-hover: 33 28% 90%;
-  --accent-foreground: 27 16% 17%;
-  --border: 33 25% 86%;
-  --input: 33 25% 86%;
-  --sidebar: 40 50% 99%;
-  --sidebar-deep: 37 35% 97%;
-  --menu: var(--sidebar);
-  --header: 40 50% 99%;
-}
-html[data-brand-theme='herbal'].dark {
-  --background: 26 16% 12%;
-  --background-deep: 25 18% 9%;
-  --foreground: 35 30% 90%;
-  --card: 26 15% 14%;
-  --card-foreground: 35 30% 90%;
-  --popover: 26 15% 14%;
-  --popover-foreground: 35 30% 90%;
-  --muted: 26 13% 19%;
-  --muted-foreground: 33 15% 68%;
-  --border: 27 15% 26%;
-  --input: 27 15% 26%;
-  --sidebar: 26 16% 12%;
-  --sidebar-deep: 25 18% 10%;
-  --menu: var(--sidebar);
-  --header: 26 16% 12%;
-}
-/* 鏆楄壊涓嬩娇鐢ㄦ槑浜湵鐮傝壊锛屼繚璇侀摼鎺ヤ笌閫変腑鎬佸彲璇伙紱鎸夐挳鎼厤娣辫壊鏂囧瓧銆� */
-html[data-brand-theme='herbal'][data-herbal-palette='true'].dark {
-  --primary: 357 64% 73% !important;
-  --primary-500: 357 64% 73% !important;
-  --primary-600: 357 69% 77% !important;
-  --primary-700: 357 70% 83% !important;
-  --primary-foreground: 27 25% 12%;
-}
-/* 鏀寔鍗婃繁鑹插鑸亸濂斤紝涓嶈娴呰壊鍝佺墝搴曡鐩栬鍋忓ソ銆� */
-html[data-brand-theme='herbal']:not(.dark) .dark {
-  --sidebar: 26 16% 12%;
-  --sidebar-deep: 25 18% 10%;
-  --menu: var(--sidebar);
-  --header: 26 16% 12%;
-}
-
diff --git a/src/views/_core/authentication/login.vue b/src/views/_core/authentication/login.vue
index 4e46c22..0a7547b 100644
--- a/src/views/_core/authentication/login.vue
+++ b/src/views/_core/authentication/login.vue
@@ -126,7 +126,7 @@
 </script>
 
 <template>
-  <div class="herbal-login">
+  <div>
     <AuthenticationLogin
       ref="loginRef"
       :form-schema="formSchema"
@@ -138,14 +138,7 @@
       :show-forget-password="false"
       :show-doc-link="false"
       @submit="handleLogin"
-    >
-      <template #title>
-        <div class="herbal-login__heading">
-          <h1>{{ $t('authentication.welcomeBack') }}<svg class="herbal-login__seal" viewBox="0 0 20 30" aria-hidden="true"><rect x="1" y="1" width="18" height="28" rx="2"/><path d="M5 5h10v8H5V5Zm0 12h10v8H5v-8Zm5-12v8m0 4v8"/></svg></h1>
-          <p>{{ $t('authentication.loginSubtitle') }}</p>
-        </div>
-      </template>
-    </AuthenticationLogin>
+    />
     <Verification
       ref="verifyRef"
       v-if="captchaEnable"
@@ -158,24 +151,3 @@
     />
   </div>
 </template>
-
-<style scoped>
-.herbal-login__heading{margin-bottom:32px}
-.herbal-login__heading h1{font-size:clamp(28px,2.4vw,36px);font-weight:700;line-height:1.4;letter-spacing:-.02em;margin:0 0 12px;color:#29251f;display:flex;align-items:center;gap:14px}
-.herbal-login__heading p{font-size:15px;line-height:1.7;color:#756d63;margin:0}
-.herbal-login__seal{width:20px;height:30px;flex-shrink:0;color:#a51d24;fill:none;stroke:currentColor;stroke-width:1.2}
-.herbal-login :deep(input:not([type='checkbox'])){min-height:56px;border-radius:9px;border:1px solid #ddd6cc;background:rgba(255,255,255,.82);padding:12px 16px;font-size:16px;color:#30281f}
-.herbal-login :deep(input::placeholder){color:#7a7167;opacity:1}
-.herbal-login :deep(input:focus-visible){outline:2px solid #a51d24;outline-offset:3px}
-.herbal-login :deep(input[autocomplete='current-password']){padding-right:44px}
-.herbal-login :deep(button[aria-label='login']){min-height:58px;margin-top:8px;border-radius:9px;background:#a51d24;color:#fff;font-size:19px;font-weight:600;letter-spacing:.12em;box-shadow:0 5px 12px rgba(137,24,30,.12)}
-.herbal-login :deep(button[aria-label='login']:hover){background:#87171d}
-.herbal-login :deep(button[aria-label='login']:focus-visible){outline:2px solid #a51d24;outline-offset:4px}
-.herbal-login :deep(button[aria-label='login']:disabled){opacity:.65;cursor:wait}
-:global(.dark .herbal-login__heading h1){color:#f5eee4}
-:global(.dark .herbal-login__heading p){color:#d1c1ae}
-:global(.dark .herbal-login__seal){color:#eea5a4}
-:global(.dark .herbal-login input:not([type='checkbox'])){background:#302720;border-color:#6f5b48;color:#f5eee4}
-:global(.dark .herbal-login input::placeholder){color:#c2b29e}
-@media(max-width:540px){.herbal-login__heading h1{font-size:28px}.herbal-login__heading p{font-size:14px}.herbal-login :deep(input:not([type='checkbox'])){min-height:52px}}
-</style>

--
Gitblit v1.9.3