vue 登录

xiaoxiao2021-02-28  32

//登录localStorage存储数据 if(window.localStorage){ const tokenString = JSON.stringify(this.hwdToken) window.localStorage.setItem('hwdtoken',tokenString); Toast({ message: '登录成功!', position: 'middle', duration: 2000 }); setTimeout(()=>{ this.$router.replace({name:'myModule'}) },2000); } //退出系统 logoutAction:function(){ window.localStorage.removeItem('hwdtoken'); this.$router.push({ name:'homeModule', replace:false }) },
转载请注明原文地址: https://www.6miu.com/read-1949990.html

最新回复(0)