diff --git a/views/login.ejs b/views/login.ejs index 023ba56..865f82f 100644 --- a/views/login.ejs +++ b/views/login.ejs @@ -50,7 +50,7 @@ function show_error(error) { $("#error").show(); } function success(session_id) { - window.location.href = <%- JSON.stringify(req.query.url || '/') %>; + window.location.href = location.protocol + '//' + location.host + <%- JSON.stringify(req.query.url || '/') %>; } function login() { password = md5($("#password").val() + "syzoj2_xxx"); diff --git a/views/sign_up.ejs b/views/sign_up.ejs index 9657738..9e9dfed 100644 --- a/views/sign_up.ejs +++ b/views/sign_up.ejs @@ -37,7 +37,7 @@ function show_error(error) { function success() { alert("注册成功!"); - window.location.href = <%- JSON.stringify(req.query.url || '/') %>; + window.location.href = location.protocol + '//' + location.host + <%- JSON.stringify(req.query.url || '/') %>; } function mail_required() {