diff --git a/static/src/js/app/oj/account/register.js b/static/src/js/app/oj/account/register.js index e6b4deb..b9d3468 100644 --- a/static/src/js/app/oj/account/register.js +++ b/static/src/js/app/oj/account/register.js @@ -2,6 +2,11 @@ require(["jquery", "bs_alert", "csrf", "validation"], function($, bs_alert, csrf $("#register-form") .formValidation({ framework: "bootstrap", + icon: { + valid: 'glyphicon glyphicon-ok', + invalid: 'glyphicon glyphicon-remove', + validating: 'glyphicon glyphicon-refresh' + }, fields: { username: { validators: { @@ -50,6 +55,21 @@ require(["jquery", "bs_alert", "csrf", "validation"], function($, bs_alert, csrf message: "两次输入的密码必须一致" } } + }, + email: { + validators: { + notEmpty: { + message: "请填写电子邮箱邮箱地址" + }, + emailAddress: { + message: "请填写有效的邮箱地址" + }, + remoteCSRF: { + message: "您已经注册过了", + url: "/api/email_check/", + field: 'email' + } + } } } } @@ -72,8 +92,6 @@ require(["jquery", "bs_alert", "csrf", "validation"], function($, bs_alert, csrf bs_alert(data.data); } } - }) }); - }); \ No newline at end of file diff --git a/template/oj/account/register.html b/template/oj/account/register.html index a93014c..34dc9a4 100644 --- a/template/oj/account/register.html +++ b/template/oj/account/register.html @@ -14,6 +14,10 @@ +