Vue登录后登出清除sessionStorage缓存
登录后将用户名存入缓存:sessionStorage.setItem('user', param.username)登出后清除缓存并跳转到登录页面:loginout(){this.$confirm('此操作将注销登录, 是否继续?', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning'
·
登录后将用户名存入缓存:
sessionStorage.setItem('user', param.username)
登出后清除缓存并跳转到登录页面:
loginout(){
this.$confirm('此操作将注销登录, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
sessionStorage.removeItem("user")
this.$router.push('/login')
}).catch(() => {
this.$message({
type: 'info',
message: '已取消操作'
});
});
},
更多推荐
已为社区贡献1条内容
所有评论(0)