add easy-mock
This commit is contained in:
@@ -23,8 +23,8 @@
|
||||
import img_404_cloud from '@/assets/404_images/404_cloud.png'
|
||||
|
||||
export default {
|
||||
data: {
|
||||
return: {
|
||||
data() {
|
||||
return {
|
||||
img_404,
|
||||
img_404_cloud
|
||||
}
|
||||
|
@@ -1,5 +0,0 @@
|
||||
<template>
|
||||
<div class="dashboard-editor-container">
|
||||
dashboard
|
||||
</div>
|
||||
</template>
|
@@ -1,38 +1,18 @@
|
||||
<template>
|
||||
<div class="dashboard-container">
|
||||
<component v-bind:is="currentRole"> </component>
|
||||
{{name}}
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import DefaultDashboard from './default/index';
|
||||
export default {
|
||||
name: 'dashboard',
|
||||
components: { DefaultDashboard },
|
||||
data() {
|
||||
return {
|
||||
currentRole: 'DefaultDashboard'
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters([
|
||||
'name',
|
||||
'avatar',
|
||||
'email',
|
||||
'introduction',
|
||||
'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>
|
||||
|
@@ -76,12 +76,11 @@
|
||||
this.$refs.loginForm.validate(valid => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
this.$store.dispatch('LoginByEmail', this.loginForm).then(() => {
|
||||
this.$store.dispatch('Login', this.loginForm).then(() => {
|
||||
this.loading = false;
|
||||
this.$router.push({ path: '/' });
|
||||
// this.showDialog = true;
|
||||
}).catch(err => {
|
||||
this.$message.error(err);
|
||||
}).catch(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user