|
|
@ -35,7 +35,7 @@ app.get('/problems', async (req, res) => { |
|
|
|
try { |
|
|
|
try { |
|
|
|
const sort = req.query.sort || syzoj.config.sorting.problem.field; |
|
|
|
const sort = req.query.sort || syzoj.config.sorting.problem.field; |
|
|
|
const order = req.query.order || syzoj.config.sorting.problem.order; |
|
|
|
const order = req.query.order || syzoj.config.sorting.problem.order; |
|
|
|
if (!['id', 'title', 'rating', 'ac_num', 'submit_num', 'ac_rate'].includes(sort) || !['asc', 'desc'].includes(order)) { |
|
|
|
if (!['id', 'title', 'rating', 'ac_num', 'submit_num', 'ac_rate', 'publicize_time'].includes(sort) || !['asc', 'desc'].includes(order)) { |
|
|
|
throw new ErrorMessage('错误的排序参数。'); |
|
|
|
throw new ErrorMessage('错误的排序参数。'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|