From 5a12e800c03cd31f30c0a89e14f3161d0bf825a6 Mon Sep 17 00:00:00 2001 From: jmal Date: Mon, 28 Apr 2025 14:38:09 +0800 Subject: [PATCH] =?UTF-8?q?refactor(api):=20=E9=87=8D=E5=91=BD=E5=90=8D?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8E=86=E5=8F=B2=E7=9B=B8=E5=85=B3=20API=20?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/file-api.js | 4 ++-- src/components/ShowFile/ShowFile.vue | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/api/file-api.js b/src/api/file-api.js index e6c881a..3e8a270 100644 --- a/src/api/file-api.js +++ b/src/api/file-api.js @@ -138,7 +138,7 @@ export default { }) }, // 最近搜索记录🔍 - recentlySearchHistory: function(params) { + getRecentlySearchHistory: function(params) { return request({ url: '/search/recentlySearchHistory', method: 'get', @@ -146,7 +146,7 @@ export default { }) }, // 删除搜索记录🔍 - deleteSearchHistory: function(params) { + removeSearchHistory: function(params) { return request({ url: '/search/deleteSearchHistory', method: 'delete', diff --git a/src/components/ShowFile/ShowFile.vue b/src/components/ShowFile/ShowFile.vue index 6024e09..58851a9 100644 --- a/src/components/ShowFile/ShowFile.vue +++ b/src/components/ShowFile/ShowFile.vue @@ -4550,7 +4550,7 @@ export default { cb([]) return } - api.recentlySearchHistory({keyword: queryString}).then(res => { + api.getRecentlySearchHistory({keyword: queryString}).then(res => { this.searchHistoryList = res.data || [] cb(this.searchHistoryList) }).catch(error => { @@ -4569,7 +4569,7 @@ export default { event.stopPropagation(); event.preventDefault(); const idToDelete = itemToDelete.id - api.deleteSearchHistory({id: idToDelete}).then(() => { + api.removeSearchHistory({id: idToDelete}).then(() => { const index = this.searchHistoryList.findIndex(item => item.id === idToDelete) this.searchHistoryList.splice(index, 1) })