mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-07-23 15:43:54 +08:00
调整搜索实现-从前端过滤改为后端查询
This commit is contained in:
@@ -382,4 +382,24 @@ export default {
|
||||
});
|
||||
}).send();
|
||||
},
|
||||
|
||||
// 搜索智能体
|
||||
searchAgent(keyword, searchType, callback) {
|
||||
RequestService.sendRequest()
|
||||
.url(`${getServiceUrl()}/agent/search`)
|
||||
.method('GET')
|
||||
.data({
|
||||
keyword: keyword,
|
||||
searchType: searchType // searchType: 'name' 或 'mac'
|
||||
})
|
||||
.success((res) => {
|
||||
RequestService.clearRequestTime();
|
||||
callback(res);
|
||||
})
|
||||
.networkFail(() => {
|
||||
RequestService.reAjaxFun(() => {
|
||||
this.searchAgent(keyword, searchType, callback);
|
||||
});
|
||||
}).send();
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user