标签:url 跳转 returnurl 登录 tor 缓存 cat path win
把当前页面地址添加到缓存里,登录成功后通过缓存获取:
当前页面添加??
sessionStorage.setItem(‘returnUrl‘, window.location.href)
window.location.href = window.location.origin + ‘/login‘
login页面增加??
if (sessionStorage.getItem(‘returnUrl‘)) { window.location.href = sessionStorage.getItem(‘returnUrl‘) } else { this.$router.push({ path: ‘/‘ }) // 如果缓存没有 直接跳转到默认路径
}
标签:url 跳转 returnurl 登录 tor 缓存 cat path win
原文地址:https://www.cnblogs.com/ximiximi-blog/p/12849606.html