export function getMenuListAndPermision() {
let resolveCb = null
let rejectCb = null
const promise = new Promise((resolve, reject) => {
resolveCb = resolve
rejectCb = reject
})
Promise.all([
getPermissionList(),
getLeftMenuList(),
getAllMenuList()
]).then(res => {
....
resolveCb(...)
}).catch(err => {
console.error('getMenuListAndPermision err:', err)
rejectCb(err)
})
return promise
}
getMenuListAndPermision().then(res => {
})..catch(err => {
console.error('err:', err)
})
网友评论