lishifeng
2020-09-15 ce10677f47a14879424e7f562f78442cc03cfda1
src/components/PageHeader.vue
@@ -11,13 +11,13 @@
                        <span class="hdw-avatar-icon">
                            <i class="iconfont el-icon-Userselect"></i>
                        </span>
                        <el-dropdown>
                        <el-dropdown @command="commandClick">
                            <span class="hdw-avatar-text">
                                superuser<i class="el-icon-arrow-down el-icon--right"></i>
                                {{username}}<i class="el-icon-arrow-down el-icon--right"></i>
                            </span>
                            <el-dropdown-menu slot="dropdown">
                                <el-dropdown-item>密码修改</el-dropdown-item>
                                <el-dropdown-item>安全退出</el-dropdown-item>
                                <el-dropdown-item command="outSystem">安全退出</el-dropdown-item>
                            </el-dropdown-menu>
                        </el-dropdown>
                    </div>
@@ -29,7 +29,26 @@
<script>
export default {
    data() {
        return {
           username: sessionStorage.getItem('username'),
        }
    },
    methods: {
        outSystem() {
            this.$router.push('/login');
        },
        commandClick(name) {
            switch(name) {
                case 'outSystem':
                    this.outSystem();
                break;
                default:
                    this.$layer.msg('该功能暂未开放!');
                break;
            }
        }
    }
}
</script>