core: problemsearch: fix '%' as keyword

This commit is contained in:
undefined committed 2023-01-02 22:14:41 +08:00
1 parent 34b0cc4d14
commit 45c6773513
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -148,7 +148,7 @@ export class ProblemMainHandler extends Handler {
let sort: string[];
let fail = false;
let pcountRelation = 'eq';
const category = flattenDeep(decodeURIComponent(q).split(' ')
const category = flattenDeep(q.split(' ')
.filter((i) => i.startsWith('category:'))
.map((i) => i.split('category:')[1]?.split(',')));
const text = q.split(' ').filter((i) => !i.startsWith('category:')).join(' ');
@@ -294,7 +294,7 @@ export class ProblemMainHandler extends Handler {
export class ProblemRandomHandler extends Handler {
@param('q', Types.Content, true)
async get(domainId: string, qs = '') {
const category = flattenDeep(decodeURIComponent(qs).split(' ')
const category = flattenDeep(qs.split(' ')
.filter((i) => i.startsWith('category:'))
.map((i) => i.split('category:')[1]?.split(',')));
const q = buildQuery(this.user);