From 8b524fbf79196277446496198ceee648513a97be Mon Sep 17 00:00:00 2001 From: liuyonghe0111 <1763195287@qq.com> Date: Mon, 15 Dec 2025 19:31:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E5=8F=98=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 15 +- src/app/(auth)/layout.tsx | 6 +- src/app/(main)/character/[id]/chat/Input.tsx | 44 +- src/app/(main)/character/[id]/chat/page.tsx | 2 +- src/app/(main)/character/[id]/page.tsx | 46 +- .../(main)/{chat => chat-history}/page.tsx | 0 .../home/components/Character/index.tsx | 8 +- .../(main)/profile/account/account-page.tsx | 56 +- .../profile/components/ProfileDropdown.tsx | 8 +- .../profile/components/ProfileFeatureList.tsx | 14 +- src/app/(main)/profile/edit/edit-page.tsx | 343 ---------- src/app/(main)/profile/edit/page.tsx | 346 +++++++++- src/app/(main)/profile/page.tsx | 92 ++- src/app/(main)/profile/profile-page.tsx | 91 --- src/app/login/components/DiscordButton.tsx | 108 ++-- src/components/ui/infinite-scroll-list.tsx | 109 ++-- src/hooks/auth.ts | 119 ++-- src/layout/BasicLayout.tsx | 22 + src/layout/BottomBar.tsx | 58 +- src/layout/Sidebar.tsx | 2 +- src/layout/Topbar.tsx | 77 ++- src/layout/components/ChatSidebar.tsx | 5 - src/lib/auth/token.ts | 81 +-- src/lib/providers.tsx | 6 +- src/mocks/browser.ts | 5 - src/mocks/handlers.ts | 593 ------------------ src/mocks/index.ts | 28 - src/mocks/server.ts | 5 - src/proxy.ts | 80 +-- src/stores/stream-chat.ts | 3 +- 30 files changed, 910 insertions(+), 1462 deletions(-) rename src/app/(main)/{chat => chat-history}/page.tsx (100%) delete mode 100644 src/app/(main)/profile/edit/edit-page.tsx delete mode 100644 src/app/(main)/profile/profile-page.tsx delete mode 100644 src/mocks/browser.ts delete mode 100644 src/mocks/handlers.ts delete mode 100644 src/mocks/index.ts delete mode 100644 src/mocks/server.ts diff --git a/.env b/.env index dde9e76..99abf66 100644 --- a/.env +++ b/.env @@ -1,17 +1,20 @@ NEXT_PUBLIC_AUTH_API_URL=https://localhost:3000/api/mock NEXT_PUBLIC_FROG_API_URL=http://35.82.37.117:8082/frog -NEXT_PUBLIC_BEAR_API_URL=https://test-bear.crushlevel.ai -NEXT_PUBLIC_LION_API_URL=https://test-lion.crushlevel.ai -NEXT_PUBLIC_SHARK_API_URL=https://test-shark.crushlevel.ai -NEXT_PUBLIC_COW_API_URL=https://test-cow.crushlevel.ai -NEXT_PUBLIC_PIGEON_API_URL=https://test-pigeon.crushlevel.ai +NEXT_PUBLIC_BEAR_API_URL=http://35.82.37.117:8082/bear +NEXT_PUBLIC_LION_API_URL=http://35.82.37.117:8082/lion +NEXT_PUBLIC_SHARK_API_URL=http://35.82.37.117:8082/shark +NEXT_PUBLIC_COW_API_URL=http://35.82.37.117:8082/cow +NEXT_PUBLIC_PIGEON_API_URL=http://35.82.37.117:8082/pigeon # A18 服务 -NEXT_PUBLIC_EDITOR_API_URL=http://35.82.37.117 +NEXT_PUBLIC_EDITOR_API_URL=http://54.223.196.180 # 三方登录 NEXT_PUBLIC_DISCORD_CLIENT_ID=1448143535609217076 +# STREAM_CHAT +NEXT_PUBLIC_STREAM_CHAT_API_KEY=rpwwpq5gvq3h + # S3 NEXT_PUBLIC_S3_URI=https://hhb.crushlevel.ai NEXT_PUBLIC_S3_IM_URI=https://img.crushlevel.ai diff --git a/src/app/(auth)/layout.tsx b/src/app/(auth)/layout.tsx index 1f99a65..6205155 100644 --- a/src/app/(auth)/layout.tsx +++ b/src/app/(auth)/layout.tsx @@ -44,7 +44,7 @@ const PolicyLayout = ({ children }: { children: React.ReactNode }) => {
{ > {isBlur &&
}
-
+
{ iconfont="icon-arrow-left" />
{title}
-
+
diff --git a/src/app/(main)/character/[id]/chat/Input.tsx b/src/app/(main)/character/[id]/chat/Input.tsx index 9e57b4d..4f4a197 100644 --- a/src/app/(main)/character/[id]/chat/Input.tsx +++ b/src/app/(main)/character/[id]/chat/Input.tsx @@ -1,36 +1,36 @@ -'use client' +'use client'; -import { IconButton } from '@/components/ui/button' -import { cn } from '@/lib/utils' -import { useState, useRef, useEffect } from 'react' +import { IconButton } from '@/components/ui/button'; +import { cn } from '@/lib/utils'; +import { useState, useRef, useEffect } from 'react'; const AuthHeightTextarea = (props: React.ComponentProps<'textarea'> & { maxHeight?: number }) => { - const { maxHeight = 200, className, value, onChange, ...restProps } = props - const textareaRef = useRef(null) + const { maxHeight = 200, className, value, onChange, ...restProps } = props; + const textareaRef = useRef(null); // 调整高度的函数 const adjustHeight = () => { - const textarea = textareaRef.current - if (!textarea) return + const textarea = textareaRef.current; + if (!textarea) return; // 先重置高度为 0,这样才能获取真实的 scrollHeight - textarea.style.height = '0px' + textarea.style.height = '0px'; // 获取内容实际需要的高度 - const scrollHeight = textarea.scrollHeight + const scrollHeight = textarea.scrollHeight; // 计算新高度:取 scrollHeight 和 maxHeight 的较小值 - const newHeight = Math.min(scrollHeight, maxHeight) - textarea.style.height = `${newHeight}px` + const newHeight = Math.min(scrollHeight, maxHeight); + textarea.style.height = `${newHeight}px`; // 如果内容超过最大高度,显示滚动条 - textarea.style.overflowY = scrollHeight > maxHeight ? 'auto' : 'hidden' - } + textarea.style.overflowY = scrollHeight > maxHeight ? 'auto' : 'hidden'; + }; // 监听内容变化,自动调整高度 useEffect(() => { - adjustHeight() - }, [value, maxHeight]) + adjustHeight(); + }, [value, maxHeight]); return (