diff --git a/element-vue/src/pages/teacher/index.vue b/element-vue/src/pages/teacher/index.vue index 9b08e89..8b42740 100644 --- a/element-vue/src/pages/teacher/index.vue +++ b/element-vue/src/pages/teacher/index.vue @@ -1,6 +1,6 @@ @@ -13,31 +13,41 @@ components: { home }, - data(){ - return{ - homePrarms:[ - { name:'个人中心',func:()=> { - console.log(this.$router) - this.$router.push('/teacher/personal') - }}, - {name:'申请实验室' ,func:()=> { - this.$router.push('/teacher/applyLab')}}, - {name:'我的课表',func:()=> { - this.$router.push('/teacher/myCourse')}} - ] - } + data() { + return { + nickname: '未登录', + homeParams: [ + { + name: '个人中心', func: () => { + console.log(this.$router) + this.$router.push('/teacher/personal') + } + }, + { + name: '申请实验室', func: () => { + this.$router.push('/teacher/applyLab') + } + }, + { + name: '我的课表', func: () => { + this.$router.push('/teacher/myCourse') + } + } + ] + } }, - methods:{ + methods: { async backLogin() { await get('lb/user/logout') - await showSuccess('退出成功',this) - setTimeout(()=>{ + await showSuccess('退出成功', this) + setTimeout(() => { this.$router.push('/login') - },1000) + }, 1000) } }, - mounted() { - console.log(this.homePrarms) + async mounted() { + this.nickname = await get('lb/user/getUserName') + console.log(this.homeParams) } }