var prevLink = document.referrer; //获取前一页面的URL地址的方法,使从哪个页面登录就返回到哪个页面。
// 登录成功提示 并返回登录前页面
$.toast("登录成功", function() {
if($.trim(prevLink) == ''){
window.location.href = '../index/';
}else{
if(prevLink.indexOf('password/index.html') != -1){
location.href = '/index.html'; //来自忘记密码页面
}else{
if (prevLink.indexOf('register') != -1) { //来自注册页面
location.href = '../index/';
}
else {
location.href = prevLink;
}
}
}
});
获取前一页面的URL地址的方法,使从哪个页面登录就返回到哪个页面
最新推荐文章于 2024-04-30 09:42:50 发布