update sidebar and logout

This commit is contained in:
AceDataCloud committed 2021-09-15 02:06:28 +08:00
1 parent 63b38f177b
commit 6df9472cf7
7 files changed
+42 -10

No files matched your search

+20 -1
View File
@@ -17,7 +17,14 @@
}}</el-button>
</div>
<div class="mt-3 pr-10 float-right" v-else>
<img :src="$store.getters.user?.avatar" class="avatar" />
<el-dropdown trigger="click">
<img :src="$store.getters.user?.avatar" class="avatar" />
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click="onLogout">{{ $t('common.button.logout') }}</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</el-col>
</el-row>
@@ -51,6 +58,10 @@ export default defineComponent({
this.$router.push({
name: 'login'
});
},
onLogout() {
this.$store.dispatch('resetAuth');
this.$router.push('/');
}
}
});
@@ -75,6 +86,14 @@ export default defineComponent({
}
.el-main {
padding: 0;
border-bottom: 1px solid rgba(0, 0, 0, 0.05);
.el-menu {
.el-menu-item {
&.is-active {
border-bottom: 3px solid var(--el-color-primary);
}
}
}
}
.avatar {
height: 40px;
+11
View File
@@ -43,3 +43,14 @@ export default defineComponent({
}
});
</script>
<style lang="scss" scoped>
.el-menu {
border-right: 1px solid rgba(0, 0, 0, 0.05);
.el-menu-item {
&.is-active {
border-left: 3px solid var(--el-color-primary);
}
}
}
</style>