From aaf2e74cbbdddf3a288db3d7d4d51ef3ba7ed550 Mon Sep 17 00:00:00 2001 From: lifizer <913626195@qq.com> Date: Thu, 27 Mar 2025 18:26:26 +0800 Subject: [PATCH] =?UTF-8?q?Feat(=E4=BA=91=E7=81=B5AI):=E5=AF=B9=E8=AF=9D?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=AF=B9=E6=8E=A5=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/chat/index.js | 2 +- utils/request.js | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/api/chat/index.js b/api/chat/index.js index 7bc9e71..80435f8 100644 --- a/api/chat/index.js +++ b/api/chat/index.js @@ -5,5 +5,5 @@ export function getSseConfigV1(data) { } export function getCompletions(params) { - return request.get('/v1/chat/sse/message', params, { login: true }) + return request.get('/v1/chat/sse/completions', params, { login: true }) } diff --git a/utils/request.js b/utils/request.js index 92df0a0..1e02249 100644 --- a/utils/request.js +++ b/utils/request.js @@ -85,6 +85,11 @@ function baseRequest(options) { // 发起请求 return http[options.method](url, _params).then(res => { + // AI对话某个请求返回为空需要处理这种情况 + if (['get', 'GET'].includes(options.method) && _params.params.isNoNeedPublicErrorNotification === 1) { + console.log('----') + return Promise.resolve({}) + } const resData = res.data || {}; if (res.statusCode !== 200) { return Promise.reject({msg: "请求失败", res, resData});