diff --git a/bns/js/public/public.js b/bns/js/public/public.js index 8d2df67..6294382 100644 --- a/bns/js/public/public.js +++ b/bns/js/public/public.js @@ -242,7 +242,7 @@ var Ajax = function () { // post方式需要自己设置http的请求头,来模仿表单提交。 // 放在open方法之后,send方法之前。 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); - xhr.setRequestHeader('token', token); + xhr.setRequestHeader('Authorization', token); //xhr.setRequestHeader("key","222"); //将token放在header 里面 if (that.headers != '') { xhr.setRequestHeader("encrypt", that.headers); diff --git a/bns/js/system/htmlpermission.js b/bns/js/system/htmlpermission.js index 0a4445a..e1d5c3d 100644 --- a/bns/js/system/htmlpermission.js +++ b/bns/js/system/htmlpermission.js @@ -6,9 +6,9 @@ function getLocalpath(){ let usJosn=JSON.parse(us); let yq=getHtmlPermission(usJosn.menus,url[1]); console.log(yq) - if(!yq){ - console.log(url[1]) - top.window.location.href = login_url; + if(yq){ + addLogs(url,url[1],usJosn.nickName); + //top.window.location.href = login_url; } } function getHtmlPermission(menus,html){ @@ -26,4 +26,20 @@ function getHtmlPermission(menus,html){ } } 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 () { + } + }); } \ No newline at end of file diff --git a/bns/js/system/public_utils.js b/bns/js/system/public_utils.js index 7beac3b..41686d3 100644 --- a/bns/js/system/public_utils.js +++ b/bns/js/system/public_utils.js @@ -14,13 +14,13 @@ function error(event, xhr, settings, er){ console.error(settings); console.error(er); } -(() => { - function ban() { - setInterval(() => { - debugger; - }, 50); - } - try { - ban(); - } catch (err) { } -})(); +// (() => { +// function ban() { +// setInterval(() => { +// debugger; +// }, 50); +// } +// try { +// ban(); +// } catch (err) { } +// })();