)}
diff --git a/src/pages/chat/components/messages/MessageItem.css b/src/pages/chat/components/messages/MessageItem.css
index f455957..d104614 100644
--- a/src/pages/chat/components/messages/MessageItem.css
+++ b/src/pages/chat/components/messages/MessageItem.css
@@ -1,78 +1,113 @@
.message-item-container {
- margin-bottom: 20px;
- transition: background 0.4s, padding 0.4s;
+ transition: background 0.3s;
}
.message-item-container.highlighted {
- padding: 8px;
- border-radius: 10px;
- background: rgba(254, 243, 199, 0.6);
+ background: var(--color-surface-2);
}
-/* Assistant Message Styles */
-.message-item-assistant {
+.message-item-assistant,
+.message-item-user {
display: flex;
gap: 12px;
- align-items: flex-start;
+ max-width: 90%;
}
-.message-item-assistant-avatar {
+.message-item-user {
+ margin-left: auto;
+ flex-direction: row-reverse;
+}
+
+.message-item-avatar {
flex-shrink: 0;
- margin-top: 2px;
- background-color: #52c41a;
+ width: 36px;
+ height: 36px;
+ border-radius: 50%;
+ box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
-.message-item-assistant-content {
- flex: 1;
+.message-item-content {
+ display: flex;
+ flex-direction: column;
min-width: 0;
}
-.message-item-assistant-header {
+.message-item-user .message-item-content {
+ align-items: flex-end;
+}
+
+.message-item-header {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 6px;
+ font-size: 13px;
}
-.message-item-assistant-name {
- font-size: 12px;
- font-weight: 400;
- color: var(--color-text-secondary);
+.message-item-name {
+ font-weight: 600;
+ color: var(--color-text);
}
-/* User Message Styles */
-.message-item-user {
- display: flex;
- gap: 12px;
- align-items: flex-start;
- justify-content: flex-end;
+.message-item-time {
+ color: var(--color-text-tertiary);
+ font-size: 11px;
}
-.message-item-user-content-wrapper {
- flex: 1;
- min-width: 0;
- max-width: 78%;
- display: flex;
- flex-direction: column;
- align-items: flex-end;
+.bubble {
+ padding: 12px 16px;
+ border-radius: 16px;
+ font-size: 14.5px;
+ line-height: 1.6;
+ position: relative;
+ word-wrap: break-word;
}
-.message-item-user-avatar {
- flex-shrink: 0;
- margin-top: 2px;
- background-color: #1890ff;
+.bubble.assistant {
+ background: #ffffff;
+ padding: 16px;
+ color: var(--color-text);
+ border-radius: 16px;
}
-.mention {
- color: var(--color-brand);
- font-weight: 500;
+.bubble.user {
+ background: var(--color-primary);
+ color: #fff;
+ border-radius: 16px;
+}
+
+.bubble.user span.mention {
+ background: rgba(255, 159, 10, 0.22);
+ border: 1px solid rgba(255, 159, 10, 0.38);
+ color: #ff9f0a;
}
.message-item-actions {
- padding-top: 4px;
- border-top: 1px solid var(--color-border);
+ display: flex;
+ align-items: center;
+ gap: 4px;
+ margin-top: 8px;
+ transition: opacity 0.2s;
+ opacity: 0;
+}
+
+.message-item-container:hover .message-item-actions {
+ opacity: 1;
}
.actions-btn {
- color: var(--color-text-secondary);
+ color: var(--color-text-tertiary) !important;
+}
+
+.actions-btn:hover {
+ color: var(--color-text-secondary) !important;
+ background: var(--color-surface-3) !important;
+}
+
+.bubble.user .markdown p {
+ color: #fff;
+}
+
+.bubble.assistant .markdown p {
+ color: var(--color-text);
}
diff --git a/src/pages/chat/components/messages/MessageItem.tsx b/src/pages/chat/components/messages/MessageItem.tsx
index 2040e6c..1008cae 100644
--- a/src/pages/chat/components/messages/MessageItem.tsx
+++ b/src/pages/chat/components/messages/MessageItem.tsx
@@ -1,6 +1,7 @@
import { Button, Dropdown, Space, Tag, Tooltip, Avatar } from 'antd';
import { useMemo } from 'react';
import { CopyOutlined, SyncOutlined } from '@ant-design/icons';
+import dayjs from 'dayjs';
import type { BranchInfo, ChatMessage } from '../../../../api';
import type { Agent } from '../../../../api/agents';
import Markdown from '../../../../components/Markdown';
@@ -37,6 +38,11 @@ export default function MessageItem(props: {
const activeIdx = branch?.activeIndex ?? 0;
const total = branch?.total ?? 1;
+ const timeStr = useMemo(() => {
+ if (!message.createdAt) return '';
+ return dayjs(message.createdAt * 1000).format('HH:mm');
+ }, [message.createdAt]);
+
const goPrev = () => {
if (!branch || !message.parentId) return;
const i = Math.max(0, activeIdx - 1);
@@ -54,81 +60,77 @@ export default function MessageItem(props: {
id={'msg-' + message.id}
className={`message-item-container ${highlighted ? 'highlighted' : ''}`}
>
- {!isUser ? (
-
-
- {answerAgent?.name?.charAt(0)?.toUpperCase() || 'A'}
-
-
-
-
- {answerAgent?.name || 'AI'}
-
-
-
+
+
+ {isUser ? '我' : (answerAgent?.name?.charAt(0)?.toUpperCase() || 'A')}
+
+
+
+
+
+ {isUser ? '我' : (answerAgent?.name || 'AI')}
+
+ {timeStr}
+
+
+
+ {isUser && !formattedContent.includes(' ? (
+
@$1')
+ }} />
+ ) : (
{formattedContent}
-
- {hasBranches && (
-
-
-
- {activeIdx + 1} / {total}
-
-
-
- )}
- {message.meta?.aborted && 已停止}
- onCopy?.(formattedContent, 'plain') },
- { key: 'markdown', label: '复制 Markdown', onClick: () => onCopy?.(formattedContent, 'markdown') }
- ]
- }}
- >
-
- } />
-
-
+ )}
+
+
+
+ {hasBranches && (
+
+
+
+ {activeIdx + 1} / {total}
+
+
+
+ )}
+ {message.meta?.aborted && 已停止}
+ onCopy?.(formattedContent, 'plain') },
+ { key: 'markdown', label: '复制 Markdown', onClick: () => onCopy?.(formattedContent, 'markdown') }
+ ]
+ }}
+ >
+
+ } />
+
+
+ {!isUser && (
} disabled={busy} onClick={() => onRegenerate?.(message.id)} />
-
-
- {!isMobile && message.meta && (
-
- {!!message.meta.reasoning && }
- {!!message.meta.retrieved?.length && }
- {!!message.meta.toolCalls?.length && }
-
- )}
-
-
- ) : (
-
-
-
- {formattedContent.includes(' ? (
- {formattedContent}
- ) : (
- @$1')
- }} />
)}
-
-
我
+
+ {/* {!isMobile && message.meta && !isUser && (
+
+ {!!message.meta.reasoning && }
+ {!!message.meta.retrieved?.length && }
+ {!!message.meta.toolCalls?.length && }
+
+ )} */}
- )}
+
);
}
diff --git a/src/pages/chat/styles/chat-page-web-standard-pc.css b/src/pages/chat/styles/chat-page-web-standard-pc.css
index 5765d0a..a12c793 100644
--- a/src/pages/chat/styles/chat-page-web-standard-pc.css
+++ b/src/pages/chat/styles/chat-page-web-standard-pc.css
@@ -1,12 +1,13 @@
.chat-shell.desktop-standardPc {
- grid-template-columns: 17.5rem minmax(0, 1fr);
+ display: flex;
}
-.chat-shell.desktop-standardPc .chat-content-row {
- grid-template-columns: minmax(0, 1fr) 260px;
+.chat-shell.desktop-standardPc .chat-side {
+ width: 300px;
+ flex-shrink: 0;
}
.chat-shell.desktop-standardPc .chat-outline {
- width: 100%;
- min-width: 0;
+ flex-shrink: 0;
}
+
diff --git a/src/pages/chat/styles/chat-page-web.css b/src/pages/chat/styles/chat-page-web.css
index 164b4ba..62fd7de 100644
--- a/src/pages/chat/styles/chat-page-web.css
+++ b/src/pages/chat/styles/chat-page-web.css
@@ -11,15 +11,28 @@
justify-content: center;
}
-.chat-shell.desktop-tablet,
-.chat-shell.desktop-smallPc,
-.chat-shell.desktop-standardPc,
-.chat-shell.desktop-large2k,
-.chat-shell.desktop-ultra4k,
-.chat-shell.desktop-tablet .chat-content-row,
-.chat-shell.desktop-smallPc .chat-content-row,
-.chat-shell.desktop-standardPc .chat-content-row,
-.chat-shell.desktop-large2k .chat-content-row,
-.chat-shell.desktop-ultra4k .chat-content-row {
- display: grid;
+.chat-content-layout {
+ display: flex;
+ height: 100%;
+ width: 100%;
+ overflow: hidden;
}
+
+.chat-conversation-panel {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+ min-width: 0;
+ height: 100%;
+ background: var(--color-bg);
+}
+
+.chat-shell.desktop-standardPc {
+ grid-template-columns: 280px minmax(0, 1fr);
+}
+
+.chat-shell.desktop-standardPc .chat-main {
+ height: 100vh;
+ overflow: hidden;
+}
+
diff --git a/src/styles.css b/src/styles.css
index e073b40..dd8b989 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -280,111 +280,6 @@ body {
overflow: hidden;
}
-.main-content {
- flex: 1;
- overflow-y: auto;
- overflow-x: hidden;
- min-height: 0;
- -webkit-overflow-scrolling: touch;
-}
-
-.main-chat {
- overflow: hidden;
-}
-
-.sidebar {
- width: 248px;
- background: var(--color-surface);
- border-right: 1px solid var(--color-border);
- color: var(--color-text);
- display: flex;
- flex-direction: column;
- padding: 14px 12px;
-}
-
-.sidebar .brand {
- font-size: 15px;
- font-weight: 700;
- color: var(--color-text);
- padding: 6px 10px 18px;
- display: flex;
- align-items: center;
- gap: 10px;
-}
-
-.sidebar .brand .brand-logo {
- width: 28px;
- height: 28px;
- flex: 0 0 auto;
- object-fit: contain;
- filter: drop-shadow(0 8px 16px rgba(17, 103, 255, 0.16));
-}
-
-.sidebar .nav-section-label {
- font-size: 11px;
- font-weight: 600;
- letter-spacing: 0.06em;
- text-transform: uppercase;
- color: var(--color-text-tertiary);
- padding: 14px 12px 6px;
-}
-
-.sidebar .nav-item {
- padding: 7px 12px;
- border-radius: 8px;
- cursor: pointer;
- display: flex;
- align-items: center;
- gap: 10px;
- margin-bottom: 1px;
- color: var(--color-text-secondary);
- text-decoration: none;
- font-size: 13.5px;
- font-weight: 500;
- transition: background 0.15s ease, color 0.15s ease;
-}
-
-.sidebar .nav-item:hover {
- background: var(--color-surface-2);
- color: var(--color-text);
-}
-
-.sidebar .nav-item.active {
- background: var(--color-brand-soft);
- color: var(--color-brand);
- font-weight: 600;
-}
-
-.sidebar .nav-item .nav-icon {
- width: 18px;
- height: 18px;
- display: inline-flex;
- align-items: center;
- justify-content: center;
- font-size: 16px;
-}
-
-.sidebar .kbd {
- font-size: 10.5px;
- color: var(--color-text-tertiary);
- background: var(--color-surface-2);
- border: 1px solid var(--color-border);
- padding: 1px 5px;
- border-radius: 4px;
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
-}
-
-.sidebar-user {
- display: flex;
- align-items: center;
- gap: 10px;
- padding: 8px 10px;
- cursor: pointer;
- border-radius: 10px;
- background: var(--color-surface-2);
- border: 1px solid var(--color-border);
-}
-
.agent-card {
background: var(--color-surface);
border-radius: 14px;
@@ -469,7 +364,7 @@ body {
}
.chat-side {
- width: 260px;
+ width: 300px;
border-right: 1px solid var(--color-border);
overflow: hidden;
display: flex;
@@ -494,135 +389,12 @@ body {
display: flex;
}
-.chat-header {
- height: 60px;
- padding: 0 24px;
- border-bottom: 1px solid var(--color-border);
- display: flex;
- align-items: center;
- justify-content: space-between;
- background: var(--color-surface);
-}
-
-.chat-header-agent {
- display: flex;
- flex-direction: column;
- gap: 2px;
- min-width: 0;
-}
-
-.chat-header-agent-title {
- display: flex;
- align-items: baseline;
- gap: 10px;
- min-width: 0;
-}
-
-.chat-header-agent-name {
- font-weight: 600;
- font-size: 16px;
- color: var(--color-text);
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- max-width: 320px;
-}
-
-.chat-header-agent-desc {
- font-size: 12px;
- color: var(--color-text-tertiary);
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- max-width: 380px;
-}
-
-.chat-header-agent-meta {
- font-size: 12px;
- color: var(--color-text-tertiary);
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- max-width: 720px;
-}
-
-.chat-header-stream-toggle {
- display: flex;
- align-items: center;
- gap: 6px;
- margin-right: 12px;
-}
-
-.is-h5 .chat-header-stream-toggle {
- margin-right: 4px;;
-}
-
-.chat-header-stream-label {
- font-size: 12px;
- color: var(--color-text-secondary);
-}
-
.chat-body {
flex: 1;
overflow-y: auto;
background: var(--color-bg);
}
-.chat-outline {
- width: 260px;
- border-left: 1px solid var(--color-border);
- background: var(--color-surface);
- padding: 14px 12px;
- overflow: auto;
-}
-
-.chat-outline-title {
- font-size: 12px;
- font-weight: 600;
- color: var(--color-text-secondary);
- margin-bottom: 10px;
-}
-
-.chat-outline-list {
- display: flex;
- flex-direction: column;
- gap: 6px;
-}
-
-.chat-outline-item {
- border: 0;
- background: var(--color-surface);
- border-radius: 10px;
- padding: 4px 10px;
- text-align: left;
- cursor: pointer;
- display: flex;
- gap: 8px;
- align-items: flex-start;
- color: var(--color-text);
-}
-
-.chat-outline-item.active {
- background-color: #eee;
-}
-
-.chat-outline-index {
- font-size: 12px;
- color: var(--color-text-tertiary);
- line-height: 1.4;
- flex: 0 0 auto;
-}
-
-.chat-outline-text {
- font-size: 12.5px;
- line-height: 1.4;
- color: var(--color-text);
- overflow: hidden;
- display: -webkit-box;
- -webkit-line-clamp: 1;
- -webkit-box-orient: vertical;
-}
-
@media (max-width: 1100px) {
.chat-content-row > .chat-outline {
display: none;
@@ -703,11 +475,6 @@ body {
padding: 1.125rem 0.75rem 6rem;
}
- .chat-input-wrapper {
- max-width: 100%;
- padding: 0 0.75rem 1rem;
- }
-
.chat-input-actions {
top: -22px;
right: 0;
@@ -747,7 +514,9 @@ body {
}
.main-content {
- min-height: 0;
+ flex: 1;
+ overflow: auto;
+ position: relative;
}
.chat-body .messages-container {
@@ -757,36 +526,10 @@ body {
padding: 16px 12px 80px;
}
-.bubble {
- max-width: 78%;
- display: inline-block;
- padding: 8px;
- border-radius: 14px;
- white-space: normal;
- word-wrap: break-word;
- line-height: 1.5;
- font-size: 14.5px;
-}
-
.is-h5 .bubble {
max-width: 94%;
}
-.bubble.user {
- background: #0a84ff;
- color: #ffffff;
- margin-left: auto;
- border-bottom-right-radius: 5px;
-}
-
-.bubble.assistant {
- background: #edf1f6;
- color: #111827;
- border: 0;
- border-bottom-left-radius: 5px;
- box-shadow: none;
-}
-
.bubble.assistant p,
.bubble.assistant h1,
.bubble.assistant h2,
@@ -851,27 +594,6 @@ body {
font-weight: 600;
}
-.chat-input-wrapper {
- width: 100%;
- max-width: 820px;
- margin: 0 auto;
- padding: 0 24px 24px;
-}
-
-.chat-input-card {
- width: 100%;
- background: var(--color-surface);
- border: 1px solid var(--color-border);
- border-radius: 20px;
- padding: 14px 16px 12px;
- min-height: 110px;
- box-shadow: var(--shadow-sm);
-}
-
-.chat-input-card-wrap {
- position: relative;
-}
-
.chat-input-actions {
position: absolute;
top: -24px;
@@ -1671,10 +1393,6 @@ body {
.border-l { border-left: 1px solid var(--color-border); }
.shadow-lg { box-shadow: var(--shadow-lg); }
-.ant-btn-primary {
- box-shadow: 0 1px 2px rgba(194, 84, 31, 0.18) !important;
-}
-
.ant-input,
.ant-input-affix-wrapper,
.ant-input-number,
@@ -1696,14 +1414,6 @@ body {
border-color: var(--color-border-strong) !important;
}
-.ant-input-affix-wrapper-focused,
-.ant-input:focus,
-.ant-select-focused .ant-select-selector,
-.ant-picker-focused {
- border-color: var(--color-brand) !important;
- box-shadow: var(--shadow-focus) !important;
-}
-
.ant-card {
background: var(--color-surface) !important;
border-color: var(--color-border) !important;
@@ -1743,12 +1453,6 @@ span.mention {
line-height: 1.3;
}
-.bubble.user span.mention {
- background: rgba(255, 159, 10, 0.22);
- border: 1px solid rgba(255, 159, 10, 0.38);
- color: #ff9f0a;
-}
-
.ant-collapse-content {
background: var(--color-surface) !important;
color: var(--color-text) !important;
@@ -2362,6 +2066,12 @@ span.mention {
border-radius: 999px;
}
+.stats-page-agent-list {
+ max-height: 240px;
+ overflow-y: auto;
+ padding-right: 4px;
+}
+
.stats-page-agent-item {
margin-bottom: 12px;
padding: 12px 14px;
diff --git a/src/styles/aura-theme.css b/src/styles/aura-theme.css
index 640d79f..94b6f51 100644
--- a/src/styles/aura-theme.css
+++ b/src/styles/aura-theme.css
@@ -1,58 +1,59 @@
:root,
[data-theme='light'] {
- --color-bg: #f5f9ff;
+ --color-bg: #FAFCFC;
--color-surface: #ffffff;
- --color-surface-2: #eef5ff;
- --color-surface-3: #dceaff;
- --color-border: #d6e5fb;
- --color-border-strong: #a9c8f6;
- --color-border-focus: #1167ff;
- --color-text: #06143f;
- --color-text-secondary: #405784;
- --color-text-tertiary: #7c8caf;
- --color-brand: #1167ff;
- --color-brand-hover: #0754df;
- --color-brand-soft: #eaf3ff;
- --color-brand-soft-2: #d7e8ff;
- --color-success: #0d9f6e;
- --color-success-soft: #e7f8f1;
- --color-warning: #b7791f;
- --color-warning-soft: #fff5dc;
- --color-danger: #cf3434;
- --color-danger-soft: #ffeaea;
- --color-info: #1e86ff;
- --color-info-soft: #e8f3ff;
- --shadow-xs: 0 1px 2px rgba(6, 20, 63, 0.04);
- --shadow-sm: 0 2px 8px rgba(17, 103, 255, 0.06);
- --shadow-md: 0 10px 26px rgba(17, 103, 255, 0.1);
- --shadow-lg: 0 18px 46px rgba(17, 103, 255, 0.14);
- --shadow-xl: 0 24px 70px rgba(6, 20, 63, 0.16);
- --shadow-focus: 0 0 0 3px rgba(17, 103, 255, 0.18);
- --gradient-brand: linear-gradient(135deg, #0b39a8 0%, #1167ff 48%, #22a6ff 100%);
- --gradient-hero: radial-gradient(900px 420px at 4% 0%, rgba(34, 166, 255, 0.18), transparent 62%),
- radial-gradient(760px 420px at 100% 8%, rgba(17, 103, 255, 0.14), transparent 58%),
- linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
+ --color-surface-2: #edfdfd;
+ --color-surface-3: #e6fffa;
+ --color-border: #E0EBEB;
+ --color-border-strong: #cbd5e0;
+ --color-border-focus: #4fd1c5;
+ --color-text: #0F1F2E;
+ --color-text-secondary: #0F1F2E;
+ --color-text-tertiary: #718096;
+ --color-primary: #5CCFC4;
+ --color-brand: #4fd1c5;
+ --color-brand-hover: #38b2ac;
+ --color-brand-soft: #e6fffa;
+ --color-brand-soft-2: #b2f5ea;
+ --color-success: #38a169;
+ --color-success-soft: #f0fff4;
+ --color-warning: #d69e2e;
+ --color-warning-soft: #fffff0;
+ --color-danger: #e53e3e;
+ --color-danger-soft: #fff5f5;
+ --color-info: #3182ce;
+ --color-info-soft: #ebf8ff;
+ --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
+ --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
+ --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
+ --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
+ --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
+ --shadow-focus: 0 0 0 3px rgba(79, 209, 197, 0.2);
+ --gradient-brand: linear-gradient(135deg, #4fd1c5 0%, #38b2ac 100%);
+ --gradient-hero: radial-gradient(900px 420px at 4% 0%, rgba(79, 209, 197, 0.15), transparent 60%),
+ radial-gradient(760px 420px at 100% 8%, rgba(56, 178, 172, 0.1), transparent 50%),
+ linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
}
[data-theme='dark'] {
- --color-bg: #071126;
- --color-surface: #0c1730;
- --color-surface-2: #111f3c;
- --color-surface-3: #17294c;
- --color-border: #1f3764;
- --color-border-strong: #31558f;
- --color-border-focus: #55a5ff;
- --color-text: #edf5ff;
- --color-text-secondary: #b6c8e8;
- --color-text-tertiary: #7f93ba;
- --color-brand: #55a5ff;
- --color-brand-hover: #7bbaff;
- --color-brand-soft: #10284f;
- --color-brand-soft-2: #17396c;
- --color-info: #72b7ff;
- --color-info-soft: #10284f;
- --gradient-brand: linear-gradient(135deg, #0b39a8 0%, #1167ff 54%, #55c2ff 100%);
- --gradient-hero: radial-gradient(900px 420px at 4% 0%, rgba(85, 165, 255, 0.18), transparent 62%),
- radial-gradient(760px 420px at 100% 8%, rgba(17, 103, 255, 0.16), transparent 58%),
- linear-gradient(180deg, #071126 0%, #0c1730 100%);
+ --color-bg: #0f172a;
+ --color-surface: #1e293b;
+ --color-surface-2: #1e293b;
+ --color-surface-3: #334155;
+ --color-border: #334155;
+ --color-border-strong: #475569;
+ --color-border-focus: #4fd1c5;
+ --color-text: #f8fafc;
+ --color-text-secondary: #94a3b8;
+ --color-text-tertiary: #64748b;
+ --color-brand: #4fd1c5;
+ --color-brand-hover: #38b2ac;
+ --color-brand-soft: #134e4a;
+ --color-brand-soft-2: #115e59;
+ --color-info: #60a5fa;
+ --color-info-soft: #1e3a8a;
+ --gradient-brand: linear-gradient(135deg, #4fd1c5 0%, #38b2ac 100%);
+ --gradient-hero: radial-gradient(900px 420px at 4% 0%, rgba(79, 209, 197, 0.18), transparent 62%),
+ radial-gradient(760px 420px at 100% 8%, rgba(56, 178, 172, 0.16), transparent 58%),
+ linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
}
diff --git a/vite.config.ts b/vite.config.ts
index 538d2b2..471caa3 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -1,11 +1,31 @@
-import { defineConfig } from 'vite';
+import { defineConfig, loadEnv } from 'vite';
import react from '@vitejs/plugin-react';
-export default defineConfig(({ command }) => ({
- // 本地开发走根路径,生产构建部署到 /aura 子路径
- base: command === 'serve' ? '/' : '/aura/',
- plugins: [react()],
- server: {
- port: 3001
- }
-}));
+// 默认走 Go 后端 :4001;要回退 Node 后端就 set VITE_API_TARGET=http://localhost:4000
+export default defineConfig(({ command, mode }) => {
+ const env = loadEnv(mode, process.cwd(), '');
+ const target = env.VITE_API_TARGET || 'https://tianchaoai.cc';
+
+ return {
+ // 本地开发走根路径,生产构建部署到 /aura 子路径
+ base: command === 'serve' ? '/' : '/aura/',
+ plugins: [react()],
+ server: {
+ port: 3001,
+ proxy: {
+ '/api': {
+ target,
+ changeOrigin: true,
+ rewrite: (path) => path.replace(/^\/api/, '/api/v1'),
+ // SSE 不要被压缩;保持长连接
+ configure: (proxy) => {
+ proxy.on('proxyReq', (proxyReq) => {
+ proxyReq.setHeader('Accept-Encoding', 'identity');
+ });
+ }
+ }
+ }
+ }
+ };
+});
+