1 this.menuList = this.roles.map(item=>{2 let hash={};3 return item.privileges.reduce((arr,item)=>{4 return (Array.isArray(arr) ? arr : arr.resources).concat(item.resources);5 },[]).reduce((item, next) => {6 hash[next.id] ? '' : hash[next.id] = true && item.push(next);7 return item;8 }, []);9 });