From 763058b5b25f23a45ad046e97599df3d710378a5 Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期五, 30 十月 2026 19:12:42 +0800
Subject: [PATCH] feat(login): 重做康意智能登录页视觉

---
 src/layouts/auth.vue |  228 +++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 207 insertions(+), 21 deletions(-)

diff --git a/src/layouts/auth.vue b/src/layouts/auth.vue
index 9bf8bb3..47fd9f9 100644
--- a/src/layouts/auth.vue
+++ b/src/layouts/auth.vue
@@ -1,13 +1,12 @@
 <script lang="ts" setup>
-import { computed, onMounted } from 'vue';
+import { computed, onMounted, ref } from 'vue';
 
-import { AuthPageLayout } from '@vben/layouts';
 import { preferences } from '@vben/preferences';
 
-import { $t } from '#/locales';
 import { useCompanyConfigStore } from '#/store/company-config';
 
 declare const __APP_LOGO__: string;
+declare const __APP_NAME__: string;
 
 const companyConfigStore = useCompanyConfigStore();
 
@@ -16,32 +15,219 @@
   companyConfigStore.loadFromServer();
 });
 
-const appName = computed(() => preferences.copyright.companyName);
+const appName = computed(
+  () => preferences.copyright.companyName || __APP_NAME__ || '搴锋剰鏅鸿兘',
+);
+
 // 鐧诲綍椤� logo 浼樺厛鍙栨暟鎹簱閰嶇疆锛坧references.logo.source锛夛紝鏈厤缃椂鍥為��缂栬瘧鏈熼粯璁� __APP_LOGO__
 const logo = computed(() => {
   const source = preferences.logo.source || __APP_LOGO__;
   // 鏈厤缃叕鍙告爣蹇楁椂涓嶅睍绀烘鏋舵紨绀� Logo銆�
   return source?.includes('@vbenjs/static-source') ? '' : source;
 });
-const logoDark = computed(() => preferences.logo.sourceDark);
-// 鏍囬/鎻忚堪浼樺厛鍙栧叕鍙镐俊鎭厤缃紝鏈厤缃椂鍥為��鏍囧搧鏂囨
-const pageTitle = computed(
-  () => companyConfigStore.loginTitle || $t('authentication.pageTitle'),
-);
-const pageDescription = computed(
-  () => companyConfigStore.loginDescription || $t('authentication.pageDesc'),
-);
+
+const DEFAULT_DESCRIPTION =
+  '瑕嗙洊璁″垝銆佺敓浜с�佽川閲忋�佷粨鍌ㄤ笌璁惧鏁伴噰鐨勪竴浣撳寲宸ヤ笟 AI 鏅洪�犲钩鍙�';
+
+/** 鍘绘帀绌虹櫧涓庢爣鐐癸紝鐢ㄤ簬鍒ゆ柇閰嶇疆鏂囨鏄惁鍙槸鎶婂搧鐗屽悕鍙堝啓浜嗕竴閬� */
+function normalizeText(text: string) {
+  return text.replace(/[\s路銆�,锛�.銆傗�擻-_/]/g, '');
+}
+
+/** 涓ゆ鏂囨鐨勫叕鍏卞墠缂�闀垮害 */
+function commonPrefixLength(a: string, b: string) {
+  const limit = Math.min(a.length, b.length);
+  let index = 0;
+  while (index < limit && a[index] === b[index]) {
+    index += 1;
+  }
+  return index;
+}
+
+const pageDescription = computed(() => {
+  const custom = companyConfigStore.loginDescription?.trim();
+  if (!custom) {
+    return DEFAULT_DESCRIPTION;
+  }
+  // 鍚庣鎶� loginDescription 濉垚浜嗐�屽悍鎰忔櫤閫犲钩鍙般�嶈繖绫诲叕鍙稿悕鍙樹綋鏃讹紝
+  // 涓绘爣棰樹笅浼氱浜屾鍑虹幇鍝佺墝鍚嶏紝杩欓噷鏀圭敤榛樿浠嬬粛
+  const text = normalizeText(custom);
+  const brand = normalizeText(appName.value);
+  const looksLikeBrand =
+    text.length <= 12 && commonPrefixLength(text, brand) >= 3;
+  return looksLikeBrand ? DEFAULT_DESCRIPTION : custom;
+});
+
+// 鍚庣鍙兘涓婁紶銆屽浘鏍�+鏂囧瓧銆嶇殑妯増缁勫悎 logo锛屽杩涙柟褰㈡浼氱缉鎴愪竴鍥紝姝ゆ椂鏀逛负鏁村紶灞曠ず骞朵笉鍐嶉噸澶嶅搧鐗屽悕
+const logoIsLockup = ref(false);
+
+function handleLogoLoad(event: Event) {
+  const img = event.target as HTMLImageElement;
+  logoIsLockup.value =
+    img.naturalWidth > 0 && img.naturalWidth / img.naturalHeight > 1.8;
+}
+
+const year = new Date().getFullYear();
+
+const highlights = [
+  { title: '鐢熶骇閫忔槑', desc: '璁㈠崟銆佸伐鍗曚笌璐ㄦ杩涘害瀹炴椂鍙' },
+  { title: '鏁版嵁椹卞姩', desc: '璁惧鏁伴噰涓庣粡钀ユ寚鏍囦竴浣撳寲鍒嗘瀽' },
+  { title: '鏅鸿兘鍗忓悓', desc: '鎵撻�� ERP / MES / WMS 涓氬姟閾捐矾' },
+];
 </script>
 
 <template>
-  <AuthPageLayout
-    :app-name="appName"
-    :logo="logo"
-    :logo-dark="logoDark"
-    :page-description="pageDescription"
-    :page-title="pageTitle"
+  <div
+    class="relative flex min-h-screen w-full overflow-hidden bg-slate-50 text-slate-900 dark:bg-slate-950 dark:text-slate-100"
   >
-    <!-- 鑷畾涔夊伐鍏锋爮 -->
-    <!-- <template #toolbar></template> -->
-  </AuthPageLayout>
+    <!-- 宸︿晶鍝佺墝鍖� -->
+    <section
+      class="relative hidden w-[54%] flex-col justify-between overflow-hidden bg-slate-950 px-14 py-12 lg:flex xl:px-20"
+    >
+      <!-- 鑳屾櫙瑁呴グ -->
+      <div class="pointer-events-none absolute inset-0">
+        <div
+          class="absolute -left-24 top-1/4 h-96 w-96 rounded-full bg-sky-500/25 blur-3xl"
+        ></div>
+        <div
+          class="absolute -bottom-24 right-0 h-[30rem] w-[30rem] rounded-full bg-indigo-500/25 blur-3xl"
+        ></div>
+        <div class="brand-grid absolute inset-0"></div>
+        <div
+          class="absolute inset-x-0 bottom-0 h-64 bg-gradient-to-t from-slate-950 to-transparent"
+        ></div>
+      </div>
+
+      <!-- 鍝佺墝 -->
+      <div class="relative z-10 flex items-center gap-3">
+        <img
+          v-if="logo"
+          :src="logo"
+          :alt="appName"
+          :class="
+            logoIsLockup
+              ? 'h-12 w-auto max-w-[15rem] object-contain'
+              : 'h-12 w-12 rounded-2xl object-contain'
+          "
+          @load="handleLogoLoad"
+        />
+        <div
+          v-else
+          class="flex h-12 w-12 items-center justify-center rounded-2xl bg-gradient-to-br from-sky-400 to-indigo-600 shadow-lg shadow-sky-500/30"
+        >
+          <span class="text-xl font-bold text-white">搴�</span>
+        </div>
+        <div v-if="!logoIsLockup" class="leading-tight">
+          <p class="text-lg font-semibold tracking-wide text-white">
+            {{ appName }}
+          </p>
+          <p class="text-[11px] tracking-[0.2em] text-slate-400">
+            KANGYI INTELLIGENT
+          </p>
+        </div>
+      </div>
+
+      <!-- 涓绘枃妗� -->
+      <div class="relative z-10 max-w-xl">
+        <p
+          class="mb-5 inline-flex items-center gap-2 rounded-full border border-sky-400/30 bg-sky-400/10 px-3 py-1 text-xs text-sky-300"
+        >
+          <span class="h-1.5 w-1.5 rounded-full bg-sky-400"></span>
+          宸ヤ笟 AI 鏅洪�犲钩鍙�
+        </p>
+        <h1
+          class="text-4xl font-bold leading-[1.2] tracking-tight text-white xl:text-5xl"
+        >
+          璁╂瘡涓�閬撳伐搴�<br />
+          <span
+            class="bg-gradient-to-r from-sky-400 via-cyan-300 to-indigo-300 bg-clip-text text-transparent"
+          >
+            閮界湅寰楄銆佺畻寰楁竻
+          </span>
+        </h1>
+        <p class="mt-5 max-w-lg text-sm leading-relaxed text-slate-300">
+          {{ pageDescription }}
+        </p>
+
+        <ul class="mt-10 grid gap-3 sm:grid-cols-3">
+          <li
+            v-for="item in highlights"
+            :key="item.title"
+            class="relative min-h-[6.25rem] overflow-hidden rounded-xl border border-white/10 bg-white/[0.04] p-4 backdrop-blur-sm transition-all hover:-translate-y-0.5 hover:border-sky-400/30 hover:bg-white/[0.07]"
+          >
+            <span
+              class="absolute inset-x-4 top-0 h-px bg-gradient-to-r from-transparent via-sky-400/60 to-transparent"
+            ></span>
+            <p class="text-sm font-medium text-white">{{ item.title }}</p>
+            <p class="mt-1.5 text-xs leading-relaxed text-slate-400">
+              {{ item.desc }}
+            </p>
+          </li>
+        </ul>
+      </div>
+
+      <div class="relative z-10 text-xs text-slate-500">
+        漏 {{ year }} {{ appName }} 路 淇濈暀鎵�鏈夋潈鍒�
+      </div>
+    </section>
+
+    <!-- 鍙充晶琛ㄥ崟鍖� -->
+    <section
+      class="relative flex flex-1 flex-col items-center justify-center px-4 py-12 sm:px-8"
+    >
+      <!-- 绉诲姩绔搧鐗� -->
+      <div class="mb-8 flex items-center gap-2.5 lg:hidden">
+        <img
+          v-if="logo"
+          :src="logo"
+          :alt="appName"
+          :class="
+            logoIsLockup
+              ? 'h-10 w-auto max-w-[12rem] object-contain'
+              : 'h-10 w-10 rounded-xl object-contain'
+          "
+          @load="handleLogoLoad"
+        />
+        <div
+          v-else
+          class="flex h-10 w-10 items-center justify-center rounded-xl bg-gradient-to-br from-sky-500 to-indigo-600"
+        >
+          <span class="text-base font-bold text-white">搴�</span>
+        </div>
+        <div v-if="!logoIsLockup" class="leading-tight">
+          <p class="text-base font-semibold">{{ appName }}</p>
+          <p class="text-[10px] tracking-[0.2em] text-slate-400">
+            KANGYI INTELLIGENT
+          </p>
+        </div>
+      </div>
+
+      <div class="w-full max-w-[26rem]">
+        <div
+          class="rounded-3xl border border-slate-200/80 bg-white p-7 shadow-[0_24px_70px_-28px_rgba(15,23,42,0.35)] sm:p-9 dark:border-slate-800 dark:bg-slate-900"
+        >
+          <RouterView />
+        </div>
+
+        <p class="mt-6 text-center text-xs text-slate-400">
+          漏 {{ year }} {{ appName }}
+        </p>
+      </div>
+    </section>
+  </div>
 </template>
+
+<style scoped>
+.brand-grid {
+  background-image:
+    linear-gradient(to right, rgb(255 255 255 / 6%) 1px, transparent 1px),
+    linear-gradient(to bottom, rgb(255 255 255 / 6%) 1px, transparent 1px);
+  background-size: 48px 48px;
+  mask-image: radial-gradient(ellipse at 40% 45%, #000 20%, transparent 78%);
+  -webkit-mask-image: radial-gradient(
+    ellipse at 40% 45%,
+    #000 20%,
+    transparent 78%
+  );
+}
+</style>

--
Gitblit v1.9.3