4
0

2 Коммитууд b279070ca4 ... f575bbd426

Эзэн SHA1 Мессеж Огноо
  sunsheng f575bbd426 Merge branch 'app-permission' of https://git.zyuas.com/LLM/chat-client-web into app-permission 3 долоо хоног өмнө
  sunsheng 77209d9af8 聊天新增base64 3 долоо хоног өмнө

+ 9 - 3
app/client/platforms/bigModel.ts

@@ -66,9 +66,15 @@ export class BigModelApi implements LLMApi {
       const userInfo = localStorage.getItem('userInfo');
       const token = userInfo ? JSON.parse(userInfo).token : "";
       const chatPath = this.apiPath;
+      const paramsflag = {...params}
+      console.log('paramsflag',paramsflag)
+      paramsflag.prompt.forEach(val => {
+        val.content = btoa(unescape(encodeURIComponent(val.content)))
+      });
       const chatPayload = {
         method: "POST",
-        body: JSON.stringify(params),
+        body: JSON.stringify(paramsflag),
+        // body: btoa(unescape(encodeURIComponent(JSON.stringify(params)))),
         signal: controller.signal,
         headers: {
           'Content-Type': 'application/json',
@@ -229,11 +235,11 @@ export class BigModelApi implements LLMApi {
             appId: session.appId,
             userId: undefined,
             dialogName: dialogName,
-            messages: session.messages.map(item => ({
+            messages: session.messages.map((item:any) => ({
               id: item.id,
               date: item.date,
               role: item.role,
-              content: item.content,
+              content: btoa(unescape(encodeURIComponent(item.content))),
               sliceInfo: item.sliceInfo,
             })),
           };

+ 1 - 1
app/components/chat.tsx

@@ -646,7 +646,7 @@ export function ChatActions(props: {
         appId: session.appId,
         messages: [
           {
-            content: record.content,
+            content: btoa(unescape(encodeURIComponent(record.content))),
             role: record.role,
           }
         ],

+ 1 - 2
next.config.mjs

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