Browse Source

Add register mail send error message

master
Menci 8 years ago
parent
commit
605483117d
  1. 5
      modules/api.js
  2. 4
      views/sign_up.ejs

5
modules/api.js

@ -85,7 +85,10 @@ app.post('/api/sign_up', async (req, res) => {
html: `<p>请点击该链接完成您在 ${syzoj.config.title} 的注册:</p><p><a href="${url}">${url}</a></p><p>如果您不是 ${req.body.username},请忽略此邮件。</p>` html: `<p>请点击该链接完成您在 ${syzoj.config.title} 的注册:</p><p><a href="${url}">${url}</a></p><p>如果您不是 ${req.body.username},请忽略此邮件。</p>`
}); });
} catch (e) { } catch (e) {
throw 2010 return res.send({
error_code: 2010,
message: require('util').inspect(e)
});
} }
res.send(JSON.stringify({ error_code: 2 })); res.send(JSON.stringify({ error_code: 2 }));

4
views/sign_up.ejs

@ -89,7 +89,7 @@ function submit() {
show_error("邮箱地址已被占用"); show_error("邮箱地址已被占用");
break; break;
case 2010: case 2010:
show_error("验证邮件发送失败"); show_error("验证邮件发送失败:\n" + data.message)A;
break; break;
case 1: case 1:
success(); success();
@ -98,7 +98,7 @@ function submit() {
mail_required(); mail_required();
break; break;
default: default:
show_error("未知错误"); show_error("未知错误" + JSON.stringify(data));
break; break;
} }
$("#sign_up").removeClass("loading"); $("#sign_up").removeClass("loading");

Loading…
Cancel
Save