|
@@ -7,7 +7,7 @@
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="4" class="right">
|
|
<el-col :span="4" class="right">
|
|
<span>{{ user ? user.name : '游客' }}</span>
|
|
<span>{{ user ? user.name : '游客' }}</span>
|
|
- <span><i class="el-icon-switch-button"></i></span>
|
|
|
|
|
|
+ <span @click="logoutBtn"><i class="el-icon-switch-button"></i></span>
|
|
</el-col>
|
|
</el-col>
|
|
</el-header>
|
|
</el-header>
|
|
<el-container class="container">
|
|
<el-container class="container">
|
|
@@ -35,7 +35,13 @@ export default {
|
|
return {};
|
|
return {};
|
|
},
|
|
},
|
|
created() {},
|
|
created() {},
|
|
- methods: {},
|
|
|
|
|
|
+ methods: {
|
|
|
|
+ // 退出登录
|
|
|
|
+ logoutBtn() {
|
|
|
|
+ localStorage.removeItem('token');
|
|
|
|
+ this.$router.push({ path: '/' });
|
|
|
|
+ },
|
|
|
|
+ },
|
|
computed: {
|
|
computed: {
|
|
...mapState(['user']),
|
|
...mapState(['user']),
|
|
},
|
|
},
|
|
@@ -55,6 +61,31 @@ export default {
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
.header {
|
|
.header {
|
|
border-bottom: 1px solid #ff0000;
|
|
border-bottom: 1px solid #ff0000;
|
|
|
|
+ .left {
|
|
|
|
+ height: 60px;
|
|
|
|
+ line-height: 60px;
|
|
|
|
+ font-size: 25px;
|
|
|
|
+ font-family: cursive;
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ }
|
|
|
|
+ .right {
|
|
|
|
+ height: 60px;
|
|
|
|
+ line-height: 60px;
|
|
|
|
+ font-size: 20px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ span {
|
|
|
|
+ padding: 0 10px;
|
|
|
|
+ i {
|
|
|
|
+ font-weight: bold;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ span:hover {
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ i {
|
|
|
|
+ color: #ff0000;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
.container {
|
|
.container {
|
|
.aside {
|
|
.aside {
|