越权日志

This commit is contained in:
haozq 2024-12-13 14:10:18 +08:00
parent 696a09287e
commit 4afb0649bd
3 changed files with 30 additions and 14 deletions

View File

@ -242,7 +242,7 @@ var Ajax = function () {
// post方式需要自己设置http的请求头来模仿表单提交。 // post方式需要自己设置http的请求头来模仿表单提交。
// 放在open方法之后send方法之前。 // 放在open方法之后send方法之前。
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.setRequestHeader('token', token); xhr.setRequestHeader('Authorization', token);
//xhr.setRequestHeader("key","222"); //将token放在header 里面 //xhr.setRequestHeader("key","222"); //将token放在header 里面
if (that.headers != '') { if (that.headers != '') {
xhr.setRequestHeader("encrypt", that.headers); xhr.setRequestHeader("encrypt", that.headers);

View File

@ -6,9 +6,9 @@ function getLocalpath(){
let usJosn=JSON.parse(us); let usJosn=JSON.parse(us);
let yq=getHtmlPermission(usJosn.menus,url[1]); let yq=getHtmlPermission(usJosn.menus,url[1]);
console.log(yq) console.log(yq)
if(!yq){ if(yq){
console.log(url[1]) addLogs(url,url[1],usJosn.nickName);
top.window.location.href = login_url; //top.window.location.href = login_url;
} }
} }
function getHtmlPermission(menus,html){ function getHtmlPermission(menus,html){
@ -27,3 +27,19 @@ function getHtmlPermission(menus,html){
} }
return false; return false;
} }
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 () {
}
});
}

View File

@ -14,13 +14,13 @@ function error(event, xhr, settings, er){
console.error(settings); console.error(settings);
console.error(er); console.error(er);
} }
(() => { // (() => {
function ban() { // function ban() {
setInterval(() => { // setInterval(() => {
debugger; // debugger;
}, 50); // }, 50);
} // }
try { // try {
ban(); // ban();
} catch (err) { } // } catch (err) { }
})(); // })();