refactor(api): 重命名搜索历史相关 API 方法
This commit is contained in:
parent
007475bce6
commit
5a12e800c0
@ -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',
|
||||
|
||||
@ -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)
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user