diff --git a/modules/api_v2.js b/modules/api_v2.js index 833265f..a8fe357 100644 --- a/modules/api_v2.js +++ b/modules/api_v2.js @@ -43,7 +43,7 @@ app.get('/api/v2/search/problem/:keyword*?', async (req, res) => { } }); - result = result.map(x => ({ name: `#${x.id}. ${x.title}`, value: x.id })); + result = result.map(x => ({ name: `#${x.id}. ${x.title}`, value: x.id, url: syzoj.utils.makeUrl(['problem', x.id]) })); res.send({ success: true, results: result }); } catch (e) { syzoj.log(e); diff --git a/views/index.ejs b/views/index.ejs index 7c15e23..b25e90a 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -103,6 +103,16 @@ <% } %> +

搜索题目

+
+ +

近期比赛

<% if (!contests || !contests.length) { %> @@ -148,4 +158,18 @@
+ <% include footer %>