From f6e582de0a2e0a89cc39cb0495e26561103c1142 Mon Sep 17 00:00:00 2001 From: haozq <1611483981@qq.com> Date: Tue, 28 Oct 2025 15:01:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/jq.js | 26 -------------------------- js/main.js | 11 +---------- js/my/permission.js | 5 ----- js/personnelPool/dome.js | 16 ---------------- js/publicJs.js | 20 +++----------------- login.html | 24 +----------------------- 6 files changed, 5 insertions(+), 97 deletions(-) diff --git a/js/jq.js b/js/jq.js index df99fe5..6c550a8 100644 --- a/js/jq.js +++ b/js/jq.js @@ -7,7 +7,6 @@ function getContextPathNew() { return result; } $.ajaxSetup({ -<<<<<<< .mine cache : false, headers : { "token" : localStorage.getItem("token") @@ -29,31 +28,6 @@ $.ajaxSetup({ layer.msg('系统错误:' + message); } } - -======= - cache: false, - headers: { - token: localStorage.getItem("token"), - }, - error: function (xhr, textStatus, errorThrown) { - var msg = xhr.responseText; - var response = JSON.parse(msg); - var code = response.code; - var message = response.message; - if (code == 400) { - layer.msg(message); - } else if (code == 401) { - localStorage.removeItem("token"); - // location.href = "/hnbcbackstage/login.html"; - location.href = pagesPathNew + "/login.html"; - } else if (code == 403) { - console.log("未授权:" + message); - layer.msg("未授权"); - } else if (code == 500) { - layer.msg("系统错误:" + message); - } - }, ->>>>>>> .theirs }); function buttonDel(data, permission, pers) { diff --git a/js/main.js b/js/main.js index 4506917..3ca6f6c 100644 --- a/js/main.js +++ b/js/main.js @@ -6,13 +6,9 @@ function initMenu() { async: false, success: function (data) { if (!$.isArray(data)) { -<<<<<<< .mine // location.href = contentPath+'/login.html'; -======= - // location.href = ctxPath + "/login.html"; - location.href = pagesPath + "/login.html"; ->>>>>>> .theirs + return; } var menu = $("#menu"); @@ -111,13 +107,8 @@ function logout() { url: ctxPath + "/logout", success: function (data) { localStorage.removeItem("token"); -<<<<<<< .mine location.href = contentPath+'/login.html'; -======= - // location.href = ctxPath + "/login.html"; - location.href = pagesPath + "/login.html"; ->>>>>>> .theirs }, }); } diff --git a/js/my/permission.js b/js/my/permission.js index 40aac05..9285ee8 100644 --- a/js/my/permission.js +++ b/js/my/permission.js @@ -3,11 +3,6 @@ function checkPermission() { $.ajax({ type : 'get', url : ctxPath + '/permissions/owns', -<<<<<<< .mine - -======= - // contentType : "application/json; charset=utf-8", ->>>>>>> .theirs async : false, success : function(data) { pers = data; diff --git a/js/personnelPool/dome.js b/js/personnelPool/dome.js index 82d25a9..0bd1150 100644 --- a/js/personnelPool/dome.js +++ b/js/personnelPool/dome.js @@ -304,25 +304,9 @@ function exportData() { a.download = "发货冲销对应表-导出.xlsx"; // 文件名 } else if (this.status === 401) { localStorage.removeItem("token"); -<<<<<<< .mine layer.msg('用户登录过期,请重新登录', {icon: 5, time: 2000}, function () { location.href = contentPath+'/login.html'; }); - - - - - -======= - layer.msg( - "用户登录过期,请重新登录", - { icon: 5, time: 2000 }, - function () { - // location.href = ctxPath + '/login.html'; - location.href = pagesPath + "/login.html"; - } - ); ->>>>>>> .theirs } a.click(); window.URL.revokeObjectURL(url); diff --git a/js/publicJs.js b/js/publicJs.js index 542a140..b481cef 100644 --- a/js/publicJs.js +++ b/js/publicJs.js @@ -1,22 +1,15 @@ // var ctxPath = getContextPath(); let contentPath="/czl-web" -var pagesPath = getContextPath(); +contentPath = getContextPath(); +console.log(contentPath); -<<<<<<< .mine let host=window.location.host; let ctxPath; console.log(window.location.protocol) ctxPath=window.location.protocol+"//"+host+"/czl"; -// ctxPath = window.location.protocol+"//192.168.0.14:42880/czl"; -// function getContextPath() { -// var pathName = document.location.pathname; -// var index = pathName.substr(1).indexOf("/"); -// var result = pathName.substr(0, index + 1); -// return result; -// } -======= + function getContextPath() { var pathName = document.location.pathname; var index = pathName.substr(1).indexOf("/"); @@ -24,10 +17,3 @@ function getContextPath() { return result; } - - - - - - ->>>>>>> .theirs diff --git a/login.html b/login.html index 3b86c57..7a32670 100644 --- a/login.html +++ b/login.html @@ -135,13 +135,8 @@ url: ctxPath + '/users/current?token=' + token, success: function (data) { localStorage.setItem("userId", data.id); -<<<<<<< .mine window.location.href=contentPath+"/index.html"; -======= - // location.href = ctxPath + '/index.html'; - location.href = pagesPath + '/index.html'; ->>>>>>> .theirs }, error: function (xhr, textStatus, errorThrown) { var msg = xhr.responseText; @@ -162,13 +157,8 @@ //请求方式 type: "GET", //请求的媒体类型 -<<<<<<< .mine // contentType: "application/json;charset=UTF-8", - -======= - // contentType: "application/json;charset=UTF-8", ->>>>>>> .theirs //请求地址 url: url, //请求成功 @@ -228,24 +218,12 @@ time: 3000, area: ['350px', '70px'] }, function () { -<<<<<<< .mine - // location.href = ctxPath + '/index.html'; window.location.href=contentPath+"/index.html"; - //location.href = '/index.html'; -======= - location.href = pagesPath + '/index.html'; - // location.href = 'http://127.0.0.1:5502/index.html'; ->>>>>>> .theirs }); } else { -<<<<<<< .mine - // location.href = ctxPath + '/index.html'; window.location.href=contentPath+"/index.html"; -======= - location.href = pagesPath + '/index.html'; - // location.href = 'http://127.0.0.1:5502/index.html'; ->>>>>>> .theirs + } }, error: function (xhr, textStatus, errorThrown) {