sunsheng il y a 4 mois
Parent
commit
7e268963a8
5 fichiers modifiés avec 30 ajouts et 49 suppressions
  1. 1 1
      app/components/chat.module.scss
  2. 13 30
      app/components/chat.tsx
  3. 5 3
      app/components/home.tsx
  4. 9 14
      app/styles/window.scss
  5. 2 1
      next.config.mjs

+ 1 - 1
app/components/chat.module.scss

@@ -280,7 +280,7 @@
   flex-direction: column;
   position: relative;
   height: 100%;
-  // background-image: url("/chat-bg.jpg");
+  background-image: url("/chat-bg.jpg");
   /* 使背景图片按比例填充容器 */
   background-size: cover;
   /* 居中显示背景图片 */

+ 13 - 30
app/components/chat.tsx

@@ -8,7 +8,7 @@ import React, {
   Fragment,
   RefObject,
 } from "react";
-import { HomeOutlined, MenuOutlined } from '@ant-design/icons';
+import { HomeOutlined, MenuOutlined,FormOutlined } from '@ant-design/icons';
 import SendWhiteIcon from "../icons/send-white.svg";
 import BrainIcon from "../icons/brain.svg";
 import RenameIcon from "../icons/rename.svg";
@@ -1152,7 +1152,7 @@ function _Chat() {
   }
 
   const init = async (chatMode?: string) => {
-    await fetchApplicationList(chatMode);
+    // await fetchApplicationList(chatMode);
   }
 
   useEffect(() => {
@@ -1167,11 +1167,13 @@ function _Chat() {
   useEffect(() => {
     const search = location.search;
     const params = new URLSearchParams(search);
-    const chatMode = params.get('chatMode');
+    // const chatMode = params.get('chatMode');
+    const chatMode = 'LOCAL';
 
     if (chatMode) {
       setSelectedFruit(chatMode as "ONLINE" | "LOCAL");
-      const appId = params.get('appId');
+      // const appId = params.get('appId');
+      const appId = '2924812721300312064';
       if (appId) {
         setAppValue(appId);
         globalStore.setSelectedAppId(appId);
@@ -1869,6 +1871,7 @@ function _Chat() {
                 />
               </div>
             }
+            {/* 获取应用列表头部展示在页面最上面 */}
             {
               false &&
               <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
@@ -1921,31 +1924,12 @@ function _Chat() {
             }
           </div>
           <div className="window-actions">
-            <div className="window-action-button">
-              <Popover
-                trigger="click"
-                title="分享该应用"
-                content={() => {
-                  const url = `${window.location.origin}/#/knowledgeChat?showMenu=false&chatMode=${selectedFruit}&appId=${appValue}`
-                  return <div>
-                    <div style={{ marginBottom: 10 }}>
-                      {url}
-                    </div>
-                    <Button onClick={() => {
-                      navigator.clipboard.writeText(url);
-                      message.success('分享链接已复制到剪贴板');
-                    }}>
-                      复制
-                    </Button>
-                  </div>
-                }
-                }>
-                <IconButton
-                  icon={<ExportIcon />}
-                  bordered
-                  title='分享该应用'
-                />
-              </Popover>
+            <div className="window-action-button" onClick={()=>{
+                localStorage.clear();
+                window.location.reload();
+            }}>
+              <IconButton text='新聊天' icon={<FormOutlined />} />
+              
             </div>
             {/* {showMaxIcon && (
             <div className="window-action-button">
@@ -2157,7 +2141,6 @@ function _Chat() {
                           </div>
                         }
                         <div className={styles["chat-message-item"]}>
-                          {JSON.stringify(message)}
                           <Markdown
                             key={message.streaming ? "loading" : "done"}
                             content={getMessageTextContent(message)}

+ 5 - 3
app/components/home.tsx

@@ -264,13 +264,15 @@ function Screen() {
 
     return (
       <>
+        {/* 招聘首页去除左边历史消息 */}
         {
-          location.pathname !== '/' &&
+          false&&location.pathname !== '/' &&
           <SideBar className={styles["sidebar-show"]} />
         }
         <WindowContent>
           <Routes>
-            <Route path='/' element={<HomeApp />} />
+            <Route path='/' element={<Chat />} />
+            {/* <Route path='/' element={<HomeApp />} /> */}
             <Route path='/knowledgeChat' element={<Chat />} />
             <Route path='/newChat' element={<Chat />} />
             <Route path='/deepseekChat' element={<DeepSeekChat />} />
@@ -366,7 +368,7 @@ export function Home() {
   }
 
   const toUninLogin = async (originUrl:string, fullUrl:string) => {
-    // return
+    return
     //测试环境
     //const loginUrl = 'https://esctest.sribs.com.cn/esc-sso/oauth2.0/authorize?client_id=e97f94cf93761f4d69e8&response_type=code';
     //生产环境

+ 9 - 14
app/styles/window.scss

@@ -1,18 +1,13 @@
 .window-header {
-  padding: 14px;
-  position: relative;
-  display: flex;
-  justify-content: space-between;
-  align-items: center;
-
-  // 背景
-  // background: rgba(255, 255, 255, 0.2);
-  background: #FFFFFF;
-  // 背景模糊程度
-  backdrop-filter: blur(2px);
-  // 上方线条
-  // border-bottom: 1px solid rgba(55, 155, 255, 0.5);
-  border-bottom: 1px solid #dedede;
+  padding: 14px 20px;
+    position: relative;
+    display: flex;
+    justify-content: space-between;
+    align-items: center;
+    background: hsla(0, 0%, 100%, .2);
+    -webkit-backdrop-filter: blur(2px);
+    backdrop-filter: blur(2px);
+    border-bottom: 1px solid rgba(55, 155, 255, .5);;
 }
 
 .window-header-title {

+ 2 - 1
next.config.mjs

@@ -93,7 +93,8 @@ if (mode !== "export") {
       {
         source: "/bigmodel-api/:path*",
         // destination: "http://192.168.3.3:8091/:path*",
-        destination: "http://192.168.3.123:8091/:path*",
+        // destination: "http://192.168.3.123:8091/:path*",
+        destination: "http://xia0miduo.gicp.net:8091/:path*",
       },
       {
         source: "/deepseek-api/:path*",