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 (