Browse Source

Fix can't redirect to original page when logged in

pull/6/head
Menci 5 years ago
parent
commit
051915ce27
  1. 1
      views/forget.ejs
  2. 1
      views/forget_confirm.ejs
  3. 4
      views/header.ejs
  4. 1
      views/login.ejs
  5. 1
      views/sign_up.ejs

1
views/forget.ejs

@ -1,5 +1,4 @@
<% this.title = '忘记密码' %> <% this.title = '忘记密码' %>
<% this.noPreserveUrl = true; %>
<% include header %> <% include header %>
<div class="ui message" id="msgBox" hidden> <div class="ui message" id="msgBox" hidden>
<p id="msgContent"></p> <p id="msgContent"></p>

1
views/forget_confirm.ejs

@ -1,5 +1,4 @@
<% this.title = '重设密码'; %> <% this.title = '重设密码'; %>
<% this.noPreserveUrl = true; %>
<% include header %> <% include header %>
<div class="ui message" id="msgBox" hidden> <div class="ui message" id="msgBox" hidden>
<p id="msgContent"></p> <p id="msgContent"></p>

4
views/header.ejs

@ -80,10 +80,10 @@
</a> </a>
<% } else { %> <% } else { %>
<div class="item"> <div class="item">
<a class="ui button" style="margin-right: 0.5em; " href="<%= syzoj.utils.makeUrl(['login'], { url: this.noPreserveUrl ? undefined : req.originalUrl }) %>"> <a class="ui button" style="margin-right: 0.5em; " href="<%= syzoj.utils.makeUrl(['login'], { url: req.query['url'] || req.originalUrl }) %>">
登录 登录
</a> </a>
<a class="ui primary button" href="<%= syzoj.utils.makeUrl(['sign_up'], { url: this.noPreserveUrl ? undefined : req.originalUrl }) %>"> <a class="ui primary button" href="<%= syzoj.utils.makeUrl(['sign_up'], { url: req.query['url'] || req.originalUrl }) %>">
注册 注册
</a> </a>
</div> </div>

1
views/login.ejs

@ -1,5 +1,4 @@
<% this.title = '登录' %> <% this.title = '登录' %>
<% this.noPreserveUrl = true; %>
<% include header %> <% include header %>
<div class="ui error message" id="error" hidden></div> <div class="ui error message" id="error" hidden></div>
<div class="ui middle aligned center aligned grid"> <div class="ui middle aligned center aligned grid">

1
views/sign_up.ejs

@ -1,5 +1,4 @@
<% this.title = '注册' %> <% this.title = '注册' %>
<% this.noPreserveUrl = true; %>
<% include header %> <% include header %>
<div class="padding"> <div class="padding">
<h1>注册</h1> <h1>注册</h1>

Loading…
Cancel
Save