Skip to content

Commit e634a68

Browse files
lqs469JacksonTian
authored andcommitted
Fix: Local search in Chinese won't use encodeURICompoent. (#135)
1 parent d754380 commit e634a68

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/controller/search.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ const Controller = require('egg').Controller;
55
class SearchController extends Controller {
66
async index() {
77
let q = this.ctx.query.q;
8-
q = encodeURIComponent(q);
8+
if (this.config.search !== 'local') {
9+
q = encodeURIComponent(q);
10+
}
911
if (q.length === 0) {
1012
return this.ctx.redirect('/');
1113
}

0 commit comments

Comments
 (0)