sunsheng 2 mesiacov pred
rodič
commit
0a014ee971

+ 7 - 6
app/client/platforms/bigModel.ts

@@ -160,7 +160,7 @@ export class BigModelApi implements LLMApi {
               });
               sliceInfoPromise = (async () => {
                 try {
-                  const res: any = await api.get(`deepseek/api/slice/search/${info.id}`);
+                  const res: any = await api.get(`deepseek/api/free/slice/search/${info.id}`);
                   let allChunkNum = 0;
                   delete res.data.code;
                   const values1 = Object.keys(res.data).reduce((acc, knowledge_id) => {
@@ -249,11 +249,12 @@ export class BigModelApi implements LLMApi {
             });
           }
           const chatMode = useChatStore.getState().chatMode;
-          if (chatMode === 'LOCAL') {
-            await api.post('deepseek/api/dialog/save', data);
-          } else {
-            await api.post('bigmodel/api/dialog/save', data);
-          }
+          //暂时不需要保存
+          // if (chatMode === 'LOCAL') {
+          //   await api.post('deepseek/api/dialog/save', data);
+          // } else {
+          //   await api.post('bigmodel/api/dialog/save', data);
+          // }
         },
         onerror(e) {
           options.onError?.(e);

+ 20 - 24
app/components/chat.module.scss

@@ -410,6 +410,9 @@
   color: #aaa;
   line-height: 1.5;
   margin-top: 5px;
+  background-color: white;
+  padding: 5px;
+  border-radius: 5px;
 }
 
 .chat-message-item {
@@ -508,23 +511,16 @@
 }
 
 .chat-input-panel {
-  position: relative;
-  width: 100%;
-  padding: 16px;
-  padding-top: 16px;
-  box-sizing: border-box;
-  flex-direction: column;
-  background: transparent;
-  // box-shadow: var(--card-shadow);
-  // 下方线条
-  border-top: 1px solid #dedede;
-  // border-top: none;
-
-  // 背景
-  // background: rgba(155, 155, 255, 0.2);
-  // 背景模糊程度
-  // backdrop-filter: blur(2px);
-
+    position: relative;
+    width: 100%;
+    padding: 10px 16px;
+    box-sizing: border-box;
+    flex-direction: column;
+    box-shadow: var(--card-shadow);
+    background: rgba(155, 155, 255, .2);
+    -webkit-backdrop-filter: blur(1px);
+    backdrop-filter: blur(1px);
+    border-top: 1px solid rgba(55, 155, 255, .5);
   .chat-input-actions {
     .chat-input-action {
       margin-bottom: 10px;
@@ -618,11 +614,11 @@
   width: 100%;
   // border-radius: 16px;
   border: none;
-  background: transparent;
+  background: hsla(0,0%,100%,.1);
   box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.03);
   color: var(--black) !important;
   font-family: inherit;
-  padding: 16px 16px 8px 16px;
+  padding: 10px 80px 10px 14px;
   resize: none;
   outline: none;
   box-sizing: border-box;
@@ -646,8 +642,8 @@
   background-color: var(--primary);
   color: white;
   position: absolute;
-  right: 30px;
-  bottom: 32px;
+  right: 10px;
+  bottom: 10px;
 }
 // 新增:输入框内部按钮区域样式
 .chat-input-bottom-bar {
@@ -785,13 +781,13 @@
   }
 
   .chat-input-send {
-    bottom: 30px;
+    bottom: 10px;
   }
   
   // 移动端输入框内部优化
   .chat-input-panel-inner {
-    min-height: 100px;
-    max-height: 120px;
+    // min-height: 100px;
+    // max-height: 120px;
   }
   
 

+ 16 - 10
app/components/chat.tsx

@@ -654,7 +654,7 @@ export function ChatActions(props: {
       }
       let url = '';
       if (chatStore.chatMode === 'LOCAL') {
-        url = '/deepseek/api/async/completions';
+        url = '/deepseek/api/free/async/completions';
       } else {
         url = '/bigmodel/api/async/completions';
       }
@@ -789,13 +789,13 @@ export function ChatActions(props: {
         />
       )} */}
 
-      {/* {!props.hitBottom && (
+      {!props.hitBottom && (
         <ChatAction
           onClick={props.scrollToBottom}
           text={Locale.Chat.InputActions.ToBottom}
           icon={<BottomIcon />}
         />
-      )} */}
+      )}
 
       {/* {props.hitBottom && (
         <ChatAction
@@ -1138,10 +1138,11 @@ function _Chat() {
     try {
       let url = null;
       if (selectedFruit === 'LOCAL') {
-        url = '/deepseek/api/presets';
-      } else {
-        url = '/bigmodel/api/presets';
-      }
+        url = '/deepseek/api/free//presets';
+      } 
+      // else {
+      //   url = '/bigmodel/api/presets';
+      // }
       const res = await api.get(url + `/${appId}`);
       setQuestionList(res.data);
     } catch (error) {
@@ -1775,10 +1776,13 @@ function _Chat() {
     const [pageLoading, setPageLoading] = useState(false);
     const [list, setList] = useState([]);
 
+/**
+* 初始化函数,用于加载页面数据
+*/
     const init = async () => {
       setPageLoading(true);
       try {
-        const res: any = await api.post('/deepseek/api/slicePage', {
+        const res: any = await api.post('/deepseek/api/free/slicePage', {
           knowledge_id: drawerData.knowledge_id,
           chunk_info: drawerData.chunk_info,
           pageNum: 1,
@@ -2082,6 +2086,7 @@ function _Chat() {
                           <div style={{ marginTop: 10 }}>
                             <Collapse
                               bordered={false}
+                              style={{ background: '#fff' }}
                               expandIcon={({ isActive }) => <CaretRightOutlined rotate={isActive ? 90 : 0} />}
                               items={[
                                 {
@@ -2339,7 +2344,7 @@ function _Chat() {
           />
         </label>
       </div>
-      <div style={{ paddingBottom: 12, textAlign: 'center', color: '#888888', fontSize: 12 }}>
+      <div style={{ paddingBottom: 12, textAlign: 'center', background:'rgba(155, 155, 255, .2)',backdropFilter: 'blur(1px)', color: '#000', fontSize: 12 }}>
         内容由AI生成,仅供参考
       </div>
       {showExport && (
@@ -2368,7 +2373,8 @@ export function Chat() {
     const search = location.search;
     const params = new URLSearchParams(search);
     const showMenu = params.get('showMenu');
-    const chatMode = params.get('chatMode');
+    // const chatMode = params.get('chatMode');
+    const chatMode = 'LOCAL';
 
     if (showMenu) {
       if (showMenu === 'true') {

+ 2 - 2
next.config.mjs

@@ -93,8 +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://xia0miduo.gicp.net:8091/:path*",
+        destination: "http://192.168.3.123:8091/:path*",
+        // destination: "http://xia0miduo.gicp.net:8091/:path*",
       },
       {
         source: "/deepseek-api/:path*",

BIN
public/chat-bg.jpg