This commit is contained in:
haozq 2025-10-28 15:01:56 +08:00
parent 09fd705032
commit f6e582de0a
6 changed files with 5 additions and 97 deletions

View File

@ -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) {

View File

@ -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
},
});
}

View File

@ -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;

View File

@ -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);

View File

@ -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

View File

@ -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) {