perf: 搜索酒店: 关键词字符处理

main
Lei OT 10 months ago
parent 85cc085729
commit 5996d9a246

@ -16,7 +16,12 @@ class Api extends BaseController {
const { limit, offset } = this.getPagination(page, size); const { limit, offset } = this.getPagination(page, size);
const { rows, count } = await heytripService.hotelSearch(keyword, { limit, offset }); let keywordStr = keyword;
keywordStr = keyword.replace(/[,'"\\;%()@&+=\-\.®–\!]/g, ''); // '[^a-zA-Z0-9 @@&&()\-\./®’"'',\!]'
keywordStr = keywordStr.replace(/\s+/g, ' ');
keywordStr = keywordStr.trim();
const { rows, count } = await heytripService.hotelSearch(keywordStr, { limit, offset });
let quoteRes = []; let quoteRes = [];

Loading…
Cancel
Save