李富豪 1 rok pred
rodič
commit
06f17cf1d2

+ 4 - 3
app/api/bigModel/route.ts

@@ -3,8 +3,9 @@ import mysql from 'mysql2/promise';
 
 // 创建全局的 MySQL 连接池
 const pool = mysql.createPool({
-  connectionLimit: 10,
+  connectionLimit: 100,
   host: 'xia0miduo.gicp.net', // 服务器地址
+  port: 3306,
   user: 'root',
   password: '123456', // 密码
   database: 'chat',
@@ -20,7 +21,7 @@ interface Request {
   }[];
 }
 
-export async function insertData(req: Request) {
+export async function POST(req: Request) {
   try {
     // 从连接池中获取连接
     const connection = await pool.getConnection()
@@ -56,7 +57,7 @@ export async function insertData(req: Request) {
   }
 }
 
-export async function getAllData() {
+export async function GET() {
   try {
     // 从连接池中获取连接
     const connection = await pool.getConnection()

+ 3 - 3
app/client/platforms/bigmodel.ts

@@ -121,10 +121,10 @@ export class BigModelApi implements LLMApi {
               }
             })
           }
-          const res = await fetch('/api/bigModel', {
-            method: 'GET',
+          await fetch('/api/bigModel', {
+            method: 'POST',
+            body: JSON.stringify(data)
           });
-          console.log(res, 'res');
         };
 
         controller.signal.onabort = finish;