add easy-mock
parent
c528bd8ad0
commit
472cbb6d65
@ -1,3 +1,4 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
NODE_ENV: '"production"'
|
NODE_ENV: '"production"',
|
||||||
|
BASE_API: '"https://easy-mock.com/mock/5950a2419adc231f356a6636/vue-admin"',
|
||||||
}
|
}
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="dashboard-editor-container">
|
|
||||||
dashboard
|
|
||||||
</div>
|
|
||||||
</template>
|
|
@ -1,38 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="dashboard-container">
|
<div class="dashboard-container">
|
||||||
<component v-bind:is="currentRole"> </component>
|
{{name}}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapGetters } from 'vuex';
|
import { mapGetters } from 'vuex';
|
||||||
import DefaultDashboard from './default/index';
|
|
||||||
export default {
|
export default {
|
||||||
name: 'dashboard',
|
name: 'dashboard',
|
||||||
components: { DefaultDashboard },
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
currentRole: 'DefaultDashboard'
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters([
|
...mapGetters([
|
||||||
'name',
|
'name',
|
||||||
'avatar',
|
|
||||||
'email',
|
|
||||||
'introduction',
|
|
||||||
'roles'
|
'roles'
|
||||||
])
|
])
|
||||||
},
|
|
||||||
created() {
|
|
||||||
if (this.roles.indexOf('admin') >= 0) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// const isEditor = this.roles.some(v => v.indexOf('editor') >= 0)
|
|
||||||
// if (!isEditor) {
|
|
||||||
// this.currentRole = 'DefaultDashboard';
|
|
||||||
// }
|
|
||||||
this.currentRole = 'DefaultDashboard';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
Reference in New Issue