feat(dashboard): getRoles改为promise
This commit is contained in:
parent
a028c90cf2
commit
c50e06ad7d
|
@ -148,11 +148,13 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getMemberSummary()
|
this.getRoles().then(() => {
|
||||||
this.getDailyPerformance()
|
this.getMemberSummary()
|
||||||
this.getMonthlyPerformance()
|
this.getDailyPerformance()
|
||||||
this.getApprovalStatus()
|
this.getMonthlyPerformance()
|
||||||
this.userInfo = JSON.parse(localStorage.getItem('userInfo'))
|
this.getApprovalStatus()
|
||||||
|
this.userInfo = JSON.parse(localStorage.getItem('userInfo'))
|
||||||
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getMemberSummary() {
|
getMemberSummary() {
|
||||||
|
|
|
@ -52,16 +52,21 @@ export default {
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getRoles() {
|
getRoles() {
|
||||||
getRouters().then((res) => {
|
return new Promise((resolve, reject) => {
|
||||||
this.roleMenu = res.data || []
|
getRouters().then((res) => {
|
||||||
if (!this.roleMenu.find((item) => item.routeName === 'summaryDashboard')) {
|
this.roleMenu = res.data || []
|
||||||
this.topList.splice(0, 1)
|
if (!this.roleMenu.find((item) => item.routeName === 'summaryDashboard')) {
|
||||||
if (this.$route.name === 'summaryDashboard') {
|
this.topList.splice(0, 1)
|
||||||
this.$router.replace({
|
if (this.$route.name === 'SummaryDashboard') {
|
||||||
name: 'Dashboard'
|
this.$router.replace({
|
||||||
})
|
name: 'Dashboard'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
reject()
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
resolve()
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue