jjsp_web/bns/js/system/htmlpermission.js

29 lines
623 B
JavaScript
Raw Normal View History

2024-12-12 14:08:30 +08:00
getLocalpath();
function getLocalpath(){
var currentPath = window.location.pathname;
var url=currentPath.split("/html");
let usJosn=JSON.parse(us);
let yq=getHtmlPermission(usJosn.menus,url[1]);
console.log(yq)
if(!yq){
console.log(url[1])
2024-12-12 14:14:23 +08:00
top.window.location.href = login_url;
2024-12-12 14:08:30 +08:00
}
}
function getHtmlPermission(menus,html){
for (var i = 0; i < menus.length; i++) {
var child=menus[i].childer;
if(!child || child.length<1){
if(menus[i].url.indexOf(html)!='-1'){
return true;
}
}else{
let wyq=getHtmlPermission(child,html);
if(wyq){
return true;
}
}
}
return false;
}