feat: 空图片统一
This commit is contained in:
parent
94fd5ba1e0
commit
d40af76800
|
@ -18,7 +18,7 @@ import './permission' // permission control
|
|||
import './utils/filter' // global filter
|
||||
import './global.less'
|
||||
import moment from 'moment'
|
||||
import { FormModel } from 'ant-design-vue'
|
||||
import { FormModel, Empty } from 'ant-design-vue'
|
||||
import { hasBtnPermission } from './utils/permissions'
|
||||
|
||||
window.Vue = Vue
|
||||
|
@ -35,7 +35,9 @@ window.Vue = Vue
|
|||
// } from 'echarts/components'
|
||||
|
||||
Vue.use(FormModel)
|
||||
Vue.use(Empty)
|
||||
Vue.prototype.hasPerm = hasBtnPermission
|
||||
Vue.prototype.$emptyImg = Empty.PRESENTED_IMAGE_SIMPLE
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
|
|
|
@ -1,22 +1,26 @@
|
|||
<template>
|
||||
<div>
|
||||
<Myhome v-if="currentRole && currentRole.code === 'student'"></Myhome>
|
||||
<a-card v-else :bordered="false" style="display: flex;justify-content:center;height: 100%">
|
||||
<a-card :bordered="false" style="display: flex;justify-content:center;height: 100%">
|
||||
<div style="margin:100px auto;">
|
||||
<img src="~@/assets/welcome.png" class="logo" alt="logo" />
|
||||
</div>
|
||||
</a-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex'
|
||||
import Myhome from '@/views/myhome/index.vue'
|
||||
// import Myhome from '@/views/myhome/index.vue'
|
||||
export default {
|
||||
components: { Myhome },
|
||||
data () {
|
||||
return {}
|
||||
},
|
||||
beforeRouteEnter (to, from, next) {
|
||||
next(vm => {
|
||||
const code = vm.$store.state.user && vm.$store.state.user.currentRole.code
|
||||
if (code === 'student') {
|
||||
vm.$router.replace({ path: '/myhome' })
|
||||
}
|
||||
})
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
currentRole: state => state.user.currentRole
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
/>
|
||||
</div>
|
||||
</template>
|
||||
<a-empty v-else></a-empty>
|
||||
<a-empty v-else :image="$emptyImg"></a-empty>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</a-card>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-empty v-else></a-empty>
|
||||
<a-empty v-else :image="$emptyImg"></a-empty>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
<!-- 系统推荐课程 start -->
|
||||
<a-col :span="24" :style="{ marginBottom: '24px' }">
|
||||
<a-card :bordered="false" title="系统推荐课程" :style="{ height: '100%' }">
|
||||
<a-row :gutter="16">
|
||||
<a-row v-if="sysList && sysList.length>0" :gutter="16">
|
||||
<a-col :span="6" :md="4" :sm="6" v-for="(item, index) in sysList" :key="index">
|
||||
<a-card
|
||||
@click="handlerContinue(item)"
|
||||
|
@ -94,6 +94,7 @@
|
|||
</a-card>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-empty v-else :image="$emptyImg"></a-empty>
|
||||
</a-card>
|
||||
</a-col>
|
||||
<!-- 系统推荐课程 end -->
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
</a-row>
|
||||
</a-card>
|
||||
</template>
|
||||
<a-empty v-else />
|
||||
<a-empty v-else :image="$emptyImg" />
|
||||
|
||||
</a-card>
|
||||
</template>
|
||||
|
|
|
@ -88,7 +88,11 @@ export default {
|
|||
},
|
||||
loginSuccess (res) {
|
||||
this.loading = false
|
||||
if (this.form.roleCode === 'student') {
|
||||
this.$router.push({ path: '/myhome' })
|
||||
} else {
|
||||
this.$router.push({ path: '/' })
|
||||
}
|
||||
// 延迟 1 秒显示欢迎信息
|
||||
setTimeout(() => {
|
||||
this.$notification.success({
|
||||
|
|
Loading…
Reference in New Issue