前端基于單頁面開發(fā)這個(gè)地方是首頁的代碼errCode==1004就是代表session已失效,進(jìn)入首頁就會(huì)調(diào)用這個(gè)接口
if(newData.errCode==1004){
this.$message({
type: 'error',
message:'您的登錄信息已失效,請重新登錄!',
duration:5000,
showClose:true
});
localStorage.removeItem('token')
localStorage.removeItem('userName')
this.$router.push({path:'/login'})
登錄頁面就是存token 就不貼了我再次登錄的時(shí)候就會(huì)一直報(bào) 您的登錄信息已失效,請重新登錄!
添加回答
舉報(bào)
0/150
提交
取消