|
|
@@ -18,7 +18,7 @@
|
|
|
<span>
|
|
|
<!-- <img width="16" src="../images/msg.png" alt=""> -->
|
|
|
肖</span>
|
|
|
- <span>退出登录</span>
|
|
|
+ <span @click="logout">退出登录</span>
|
|
|
</div>
|
|
|
</el-header>
|
|
|
<el-container class="main">
|
|
|
@@ -68,18 +68,13 @@ export default {
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
-
|
|
|
+ logout(){
|
|
|
+ this.$api.logout().then(res=>{
|
|
|
+ this.$router.push({path:'/login'})
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
$route(to){
|
|
|
- // if(to.path.indexOf('add')){
|
|
|
- // this.path=to.path.split('/add')[0]
|
|
|
- // }
|
|
|
- // if(to.path.indexOf('edit')){
|
|
|
- // this.path=to.path.split('/edit')[0]
|
|
|
- // }
|
|
|
- // if(to.path.indexOf('detail')){
|
|
|
- // this.path=to.path.split('/detail')[0]
|
|
|
- // }
|
|
|
},
|
|
|
created(){
|
|
|
// if(this.$route.path.indexOf('add')>=0){
|