增加登陆后跳转回来源页
This commit is contained in:
@@ -14,8 +14,15 @@ require(["jquery", "bsAlert", "csrfToken", "validator"], function ($, bsAlert, c
|
||||
//成功登陆
|
||||
var ref = document.referrer;
|
||||
if(ref){
|
||||
if(ref.split("/")[2] == location.hostname){
|
||||
// 注册页和本页的来源的跳转回首页,防止死循环
|
||||
if(ref.indexOf("register") > -1 || ref.indexOf("login") > -1){
|
||||
location.href = "/";
|
||||
return;
|
||||
}
|
||||
// 判断来源,只有同域下才跳转
|
||||
if(ref.split("/")[2].split(":")[0] == location.hostname){
|
||||
location.href = ref;
|
||||
return;
|
||||
}
|
||||
}
|
||||
location.href = "/";
|
||||
|
||||
Reference in New Issue
Block a user