使用addRoutes重构权限

This commit is contained in:
Pan
2017-05-17 16:26:33 +08:00
parent 624af00ba3
commit faea4d8bf6
10 changed files with 191 additions and 192 deletions

View File

@@ -28,4 +28,8 @@
}
};
</script>
<style scoped>
.errPage-container{
padding: 30px;
}
</style>

View File

@@ -26,7 +26,7 @@
</template>
<script>
import { mapGetters } from 'vuex'
import { mapGetters } from 'vuex';
import Levelbar from './Levelbar';
import Hamburger from 'components/Hamburger';
import ErrLog from 'components/ErrLog';
@@ -56,7 +56,7 @@
},
logout() {
this.$store.dispatch('LogOut').then(() => {
this.$router.push({ path: '/login' })
location.reload();// 为了重新实例化vue-router对象 避免bug
});
}
}

View File

@@ -1,6 +1,6 @@
<template>
<el-menu :unique-opened='true' mode="vertical" theme="dark" :default-active="$route.path">
<template v-for="item in permissionRoutes" v-if="!item.hidden">
<template v-for="item in permission_routers" v-if="!item.hidden">
<el-submenu :index="item.name" v-if="!item.noDropdown">
<template slot="title">
<wscn-icon-svg :icon-class="item.icon||'wenzhang1'" /> {{item.name}}
@@ -21,13 +21,14 @@
</template>
<script>
import permissionRoutes from 'store/permission';
import { mapGetters } from 'vuex';
export default {
name: 'Sidebar',
data() {
return {
permissionRoutes: permissionRoutes.get()
}
computed: {
...mapGetters([
'permission_routers'
])
}
}
</script>