// 递归处理后台返回的数据,从而根据数据判断是否具有访问权限
getInfo(){
this.$store. dispatch(' user/getInfo'). then(res=>{
var menulist =res. menuvoList: this. routePath(menuList); console. log(this. pathlist); localStorage. setItem("pathlist",J50N. stringify(this. pathlist))
}). catch(err=>{
this. loading=false
})},
routePath(menuList){
for(var i=0;i<menuList. length;i++){
if(menuList[i]. children. length>0){
this. pathlist. push(menuList[i]. meta. title)
this. routePath(menuList[i]. children); elsef this. pathlist. push(menuList[i]. meta. title)
}}
return this. pathlist
}}
//判断
if(this.pathList.indexof("边")==-1){
UdNotice({
noticeType:'message type:'warning message:"您没有访问权限!!
duration:5000
})
}else{ this.$router.push({path:"/zituside",query:{fileld:this.temp.filerd})}
递归处理后台返回的数据,根据数据判断是否具有访问权限
最新推荐文章于 2022-02-03 11:23:54 发布