2024-12-19 16:09:23 +08:00
|
|
|
let sjurl=['/base/log/child/systemLog.html','/base/log/child/businessLog.html','/base/log/child/errLog.html','/base/log/child/logAnalysis.html','/base/log/child/logCapacityConfiguration.html']
|
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);
|
2024-12-19 16:09:23 +08:00
|
|
|
if(sjurl.includes(url[1])){
|
|
|
|
|
url[1]='/base/log/logManage.html';
|
|
|
|
|
}
|
2024-12-12 14:08:30 +08:00
|
|
|
let yq=getHtmlPermission(usJosn.menus,url[1]);
|
|
|
|
|
console.log(yq)
|
2024-12-13 14:34:16 +08:00
|
|
|
if(!yq){
|
2024-12-19 16:09:23 +08:00
|
|
|
|
2024-12-13 14:10:18 +08:00
|
|
|
addLogs(url,url[1],usJosn.nickName);
|
2024-12-13 14:34:16 +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;
|
2024-12-13 14:10:18 +08:00
|
|
|
}
|
|
|
|
|
function addLogs(url,urlParam,userName) {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: dataUrl + 'system/sys/logs/addLogs' ,
|
|
|
|
|
headers: {
|
|
|
|
|
'Authorization': localStorage.getItem("tokens")
|
|
|
|
|
},
|
|
|
|
|
data: {
|
|
|
|
|
'userName': userName ,
|
|
|
|
|
'operParam': url,
|
|
|
|
|
'operMeth': urlParam
|
|
|
|
|
},
|
|
|
|
|
type: 'post',
|
|
|
|
|
success: function () {
|
|
|
|
|
}
|
|
|
|
|
});
|
2024-12-12 14:08:30 +08:00
|
|
|
}
|