diff --git a/.env.development b/.env.development index e5c45f1..32e483b 100644 --- a/.env.development +++ b/.env.development @@ -1,2 +1,2 @@ # 开发环境 API 地址 -VITE_API_BASE_URL=https://bbs.littlelan.cn/api/v1 \ No newline at end of file +VITE_API_BASE_URL=https://withyou.littlelan.cn/api/v1 \ No newline at end of file diff --git a/src/api/client.ts b/src/api/client.ts index 97eec2c..bc1cf0d 100644 --- a/src/api/client.ts +++ b/src/api/client.ts @@ -2,7 +2,7 @@ import axios from 'axios' import { useAuthStore } from '@/stores/authStore' const apiClient = axios.create({ - baseURL: import.meta.env.VITE_API_BASE_URL || 'https://bbs.littlelan.cn/api/v1', + baseURL: import.meta.env.VITE_API_BASE_URL || 'https://withyou.littlelan.cn/api/v1', timeout: 10000, headers: { 'Content-Type': 'application/json', diff --git a/src/components/Layout/Sidebar.tsx b/src/components/Layout/Sidebar.tsx index 18b7a27..89390b1 100644 --- a/src/components/Layout/Sidebar.tsx +++ b/src/components/Layout/Sidebar.tsx @@ -206,7 +206,7 @@ export default function Sidebar({ collapsed, onCollapse }: SidebarProps) { {/* Logo区域 */}
{!collapsed && ( - Carrot BBS + WithYou )}
)} diff --git a/src/pages/Dashboard.tsx b/src/pages/Dashboard.tsx index 36c1d85..825ac6b 100644 --- a/src/pages/Dashboard.tsx +++ b/src/pages/Dashboard.tsx @@ -1,4 +1,4 @@ -import { useState, useEffect } from 'react' +import { useState, useEffect } from 'react' import { Users, FileText, MessageSquare, Clock, TrendingUp, Calendar, CalendarDays, CalendarRange } from 'lucide-react' import { StatsCard } from '@/components/StatsCard' import { ActivityChart } from '@/components/ActivityChart' @@ -78,7 +78,7 @@ export default function Dashboard() {

Dashboard

-

欢迎来到 Carrot BBS 管理后台

+

欢迎来到 WithYou 管理后台

{/* 统计卡片 */} diff --git a/src/pages/Login.tsx b/src/pages/Login.tsx index 78fee0c..ef76719 100644 --- a/src/pages/Login.tsx +++ b/src/pages/Login.tsx @@ -1,4 +1,4 @@ -import { useState } from 'react' +import { useState } from 'react' import { useNavigate, useLocation } from 'react-router-dom' import { useAuthStore } from '@/stores/authStore' import { Button } from '@/components/ui/button' @@ -62,7 +62,7 @@ export default function Login() { C
- Carrot BBS + WithYou 管理后台登录
diff --git a/src/pages/Posts.tsx b/src/pages/Posts.tsx index 0a329f6..8bf689c 100644 --- a/src/pages/Posts.tsx +++ b/src/pages/Posts.tsx @@ -636,8 +636,25 @@ export default function Posts() {

{selectedPost.title}

-

{selectedPost.content}

+

+ {selectedPost.content?.split(/@(\S+)/g).map((part, i) => + i % 2 === 1 ? @{part} : part + )} +

+ {/* 投票信息(从 segments 解析) */} + {selectedPost.segments?.filter(s => s.type === 'vote').map((seg, i) => ( +
+
+ 📊 投票 +
+ {seg.data?.options?.map((opt: any, j: number) => ( +
+ {j + 1}. {opt.content} +
+ ))} +
+ ))}
{/* 图片展示 */} diff --git a/src/types/index.ts b/src/types/index.ts index 92a35af..30bf613 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -58,17 +58,25 @@ export interface PostImage { height?: number } +// 消息段类型 +export interface MessageSegment { + type: string + data: Record +} + // 帖子 export interface Post { id: string title: string content: string + segments?: MessageSegment[] author: User status: PostStatus likes_count: number comments_count: number views_count: number images?: PostImage[] + is_vote?: boolean created_at: string updated_at: string }