Browse Source

Merge branch 'master' of zhaojunzhe/fair-web into master

pull/31/head
richie 5 years ago committed by Gogs
parent
commit
c042ef9b4c
  1. 2
      modules/api.js
  2. 2
      views/ranklist.ejs

2
modules/api.js

@ -72,7 +72,7 @@ app.post('/api/sign_up', async (req, res) => {
user = await User.findOne({ where: { email: req.body.email } }); user = await User.findOne({ where: { email: req.body.email } });
if (user) throw 2009; if (user) throw 2009;
if (!req.body.nickname) { if (!req.body.nickname.trim()) {
res.send({ res.send({
error_code: 2300, error_code: 2300,
message : "昵称不能为空" message : "昵称不能为空"

2
views/ranklist.ejs

@ -39,7 +39,7 @@
%> %>
<tr> <tr>
<td><b><%= i %></b></td> <td><b><%= i %></b></td>
<td><a href="<%= syzoj.utils.makeUrl(['user', user.id]) %>"><%= user.nickname %></a><% if (user.nameplate) { %><%- user.nameplate %><% } %></td> <td><a href="<%= syzoj.utils.makeUrl(['user', user.id]) %>"><% if(!user.nickname || user.nickname.trim() === '') { %> <%= user.username %> <% } else { %> <%= user.nickname %> <% } %></a><% if (user.nameplate) { %><%- user.nameplate %><% } %></td>
<td><%= user.ac_num %></td> <td><%= user.ac_num %></td>
<td><%= user.submit_num %></td> <td><%= user.submit_num %></td>
<td><%= user.ac_num && user.submit_num ? Math.round(user.ac_num / user.submit_num * 10000) / 100.00 + "%" : 0%></td> <td><%= user.ac_num && user.submit_num ? Math.round(user.ac_num / user.submit_num * 10000) / 100.00 + "%" : 0%></td>

Loading…
Cancel
Save