Feat(云灵AI):对话接口对接完成
This commit is contained in:
+1
-1
@@ -5,5 +5,5 @@ export function getSseConfigV1(data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function getCompletions(params) {
|
export function getCompletions(params) {
|
||||||
return request.get('/v1/chat/sse/message', params, { login: true })
|
return request.get('/v1/chat/sse/completions', params, { login: true })
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -85,6 +85,11 @@ function baseRequest(options) {
|
|||||||
|
|
||||||
// 发起请求
|
// 发起请求
|
||||||
return http[options.method](url, _params).then(res => {
|
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 || {};
|
const resData = res.data || {};
|
||||||
if (res.statusCode !== 200) {
|
if (res.statusCode !== 200) {
|
||||||
return Promise.reject({msg: "请求失败", res, resData});
|
return Promise.reject({msg: "请求失败", res, resData});
|
||||||
|
|||||||
Reference in New Issue
Block a user