setTimeout(() => {
// 如果已经登陆
if (_this.isLogin) {
// 如果选择记住密码
if (document.getElementById('rememberPassword').checked) {
let userinfo = { username: _this.username, password: _this.password, checked: true }
localStorage.setItem('userinfo', JSON.stringify(userinfo))
} else {
localStorage.removeItem('userinfo')
localStorage.removeItem('rememberPassword')
}
// 跳转到首页
this.$router.push({ path: '/main' }) // 登录成功之后重定向到首页
} else {
console.log(_this.isLogin)
}
// 等待100毫秒
}, 100)
js 等待一段时间后执行
猜你喜欢
转载自blog.csdn.net/sunfellow2009/article/details/84954250
今日推荐
周排行