diff --git a/src/app.tsx b/src/app.tsx index a7ae802..58edbbb 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -18,6 +18,7 @@ import '@ant-design/v5-patch-for-react-19'; const isDev = process.env.NODE_ENV === 'development'; const loginPath = '/user/login'; +const chatPath = '/chat'; /** * @see https://umijs.org/docs/api/runtime-config#getinitialstate @@ -79,7 +80,13 @@ export const layout: RunTimeLayoutConfig = ({ waterMarkProps: { content: initialState?.currentUser?.name, }, - footerRender: () => , + footerRender: () => { + const { location } = history; + if (location.pathname?.startsWith(chatPath)) { + return null; + } + return + }, onPageChange: () => { const { location } = history; // 如果没有登录,重定向到 login diff --git a/src/components/Custom/ChatList/ChatItem.tsx b/src/components/Custom/ChatList/ChatItem.tsx new file mode 100644 index 0000000..ae38531 --- /dev/null +++ b/src/components/Custom/ChatList/ChatItem.tsx @@ -0,0 +1,19 @@ +import styles from './index.less'; +import { ChatMessage } from './types' + +type ChatItemProps = { + message: ChatMessage +} + +export function ChatItem({ message }: ChatItemProps) { + const isUser = message.role === 'user' + + return ( +