Skip to content

Commit

Permalink
user 添加登出方法
Browse files Browse the repository at this point in the history
  • Loading branch information
suvvm committed Nov 30, 2019
1 parent 0317d8e commit 63cd08f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pages/user/user.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

<van-cell-group v-if="userInfo.power != 2">
<van-cell title="关于我们" icon="chat-o" is-link @click="toAboutUs()"/>
<van-cell title="退出登录" icon="down" is-link />
<van-cell title="退出登录" icon="down" is-link @click="logout()"/>
</van-cell-group>

<van-tabbar route>
Expand Down Expand Up @@ -108,6 +108,12 @@
this.$router.push({
path: '/pages/AboutUs/AboutUs',
});
},
logout() {
this.$cookies.remove("userInfo");
this.$router.push({
path: '/pages/index/index',
});
}
}
}
Expand Down

0 comments on commit 63cd08f

Please sign in to comment.