|
|
|
@ -9,7 +9,7 @@ app.get('/ranklist', async (req, res) => {
|
|
|
|
|
try { |
|
|
|
|
const sort = req.query.sort || syzoj.config.sorting.ranklist.field; |
|
|
|
|
const order = req.query.order || syzoj.config.sorting.ranklist.order; |
|
|
|
|
if (!['ac_num', 'rating', 'id', 'username'].includes(sort) || !['asc', 'desc'].includes(order)) { |
|
|
|
|
if (!['ac_num', 'submit_num', 'rating', 'id', 'username'].includes(sort) || !['asc', 'desc'].includes(order)) { |
|
|
|
|
throw new ErrorMessage('错误的排序参数。'); |
|
|
|
|
} |
|
|
|
|
let paginate = syzoj.utils.paginate(await User.countForPagination({ is_show: true }), req.query.page, syzoj.config.page.ranklist); |
|
|
|
|