Fix(云灵AI):县域AI删除历史对话使用独立接口和参数
This commit is contained in:
@@ -113,7 +113,8 @@
|
||||
import {
|
||||
getChatList,
|
||||
deleteChatListByType,
|
||||
getCountyAiChatList
|
||||
getCountyAiChatList,
|
||||
deleteCountyChatListByType
|
||||
} from '@/api/chat/index'
|
||||
export default {
|
||||
name: 'AiHistoryList',
|
||||
@@ -167,7 +168,15 @@ export default {
|
||||
})
|
||||
},
|
||||
deleteRecords(type) {
|
||||
deleteChatListByType(type).then(res => {
|
||||
let reqFn = null
|
||||
let params = ''
|
||||
if (this.countyId) {
|
||||
reqFn = deleteCountyChatListByType
|
||||
params = `?countyId=${this.countyId}&type=${type}`
|
||||
} else {
|
||||
reqFn = deleteChatListByType
|
||||
}
|
||||
reqFn(type, params).then(res => {
|
||||
const { success } = res
|
||||
if (success) {
|
||||
this.getChatListReq()
|
||||
|
||||
@@ -38,6 +38,10 @@ export function deleteChatListByType(type) {
|
||||
return request.delete('/v1/chat/type/' + type, {}, { login: true })
|
||||
}
|
||||
|
||||
export function deleteCountyChatListByType(type, params) {
|
||||
return request.delete('/county-ai/chat/type/' + type + params, {}, { login: true })
|
||||
}
|
||||
|
||||
export function getWeatherData(params) {
|
||||
return request.get('/v1/chat/weatherData', params, { login: true })
|
||||
}
|
||||
|
||||
+3
-3
@@ -80,7 +80,7 @@ function baseRequest(options) {
|
||||
_params = {
|
||||
params: params
|
||||
}
|
||||
} else if (['post', 'POST'].includes(options.method)) {
|
||||
} else if (['post', 'POST', 'put', 'PUT', 'patch', 'PATCH', 'delete', 'DELETE'].includes(options.method)) {
|
||||
_params = params || data
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ function baseRequest(options) {
|
||||
* 参考文档 https://www.kancloud.cn/yunye/axios/234845
|
||||
*
|
||||
*/
|
||||
const request = ["post", "put", "patch"].reduce((request, method) => {
|
||||
const request = ["post", "put", "patch", "delete"].reduce((request, method) => {
|
||||
/**
|
||||
*
|
||||
* @param url string 接口地址
|
||||
@@ -169,7 +169,7 @@ const request = ["post", "put", "patch"].reduce((request, method) => {
|
||||
return request;
|
||||
}, {});
|
||||
|
||||
["get", "delete", "head"].forEach(method => {
|
||||
["get", "head"].forEach(method => {
|
||||
/**
|
||||
*
|
||||
* @param url string 接口地址
|
||||
|
||||
Reference in New Issue
Block a user