From 7ee65297de4650e6a8152b68198def1fe6624cf8 Mon Sep 17 00:00:00 2001 From: lifizer <913626195@qq.com> Date: Mon, 29 Jun 2026 17:26:18 +0800 Subject: [PATCH] =?UTF-8?q?Fix(=E4=BA=91=E7=81=B5AI):=E5=8E=BF=E5=9F=9FAI?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8E=86=E5=8F=B2=E5=AF=B9=E8=AF=9D=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=8B=AC=E7=AB=8B=E6=8E=A5=E5=8F=A3=E5=92=8C=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aiChat/components/historyList.vue | 13 +++++++++++-- api/chat/index.js | 4 ++++ utils/request.js | 6 +++--- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/aiChat/components/historyList.vue b/aiChat/components/historyList.vue index bdcb3c1..0594611 100644 --- a/aiChat/components/historyList.vue +++ b/aiChat/components/historyList.vue @@ -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() diff --git a/api/chat/index.js b/api/chat/index.js index e831dc6..578b4a6 100644 --- a/api/chat/index.js +++ b/api/chat/index.js @@ -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 }) } diff --git a/utils/request.js b/utils/request.js index aec2d7a..c629915 100644 --- a/utils/request.js +++ b/utils/request.js @@ -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 接口地址