From 3d3c7f3e6b4e6c0111b7a517d7b3a499727bf750 Mon Sep 17 00:00:00 2001 From: Romesum Date: Thu, 7 May 2020 01:48:56 +0800 Subject: [PATCH] =?UTF-8?q?[fix][V]=EF=BC=9A=E5=AE=8C=E6=88=90=E5=AF=B9?= =?UTF-8?q?=E6=8E=A5=E7=94=A8=E6=88=B7=E5=90=8D=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- element-vue/src/pages/teacher/index.vue | 50 +++++++++++++++---------- 1 file changed, 30 insertions(+), 20 deletions(-) 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) } }