This commit is contained in:
parent
09fd705032
commit
f6e582de0a
26
js/jq.js
26
js/jq.js
|
|
@ -7,7 +7,6 @@ function getContextPathNew() {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
$.ajaxSetup({
|
$.ajaxSetup({
|
||||||
<<<<<<< .mine
|
|
||||||
cache : false,
|
cache : false,
|
||||||
headers : {
|
headers : {
|
||||||
"token" : localStorage.getItem("token")
|
"token" : localStorage.getItem("token")
|
||||||
|
|
@ -29,31 +28,6 @@ $.ajaxSetup({
|
||||||
layer.msg('系统错误:' + message);
|
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) {
|
function buttonDel(data, permission, pers) {
|
||||||
|
|
|
||||||
11
js/main.js
11
js/main.js
|
|
@ -6,13 +6,9 @@ function initMenu() {
|
||||||
async: false,
|
async: false,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
if (!$.isArray(data)) {
|
if (!$.isArray(data)) {
|
||||||
<<<<<<< .mine
|
|
||||||
//
|
//
|
||||||
location.href = contentPath+'/login.html';
|
location.href = contentPath+'/login.html';
|
||||||
=======
|
|
||||||
// location.href = ctxPath + "/login.html";
|
|
||||||
location.href = pagesPath + "/login.html";
|
|
||||||
>>>>>>> .theirs
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var menu = $("#menu");
|
var menu = $("#menu");
|
||||||
|
|
@ -111,13 +107,8 @@ function logout() {
|
||||||
url: ctxPath + "/logout",
|
url: ctxPath + "/logout",
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
localStorage.removeItem("token");
|
localStorage.removeItem("token");
|
||||||
<<<<<<< .mine
|
|
||||||
location.href = contentPath+'/login.html';
|
location.href = contentPath+'/login.html';
|
||||||
|
|
||||||
=======
|
|
||||||
// location.href = ctxPath + "/login.html";
|
|
||||||
location.href = pagesPath + "/login.html";
|
|
||||||
>>>>>>> .theirs
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,6 @@ function checkPermission() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type : 'get',
|
type : 'get',
|
||||||
url : ctxPath + '/permissions/owns',
|
url : ctxPath + '/permissions/owns',
|
||||||
<<<<<<< .mine
|
|
||||||
|
|
||||||
=======
|
|
||||||
// contentType : "application/json; charset=utf-8",
|
|
||||||
>>>>>>> .theirs
|
|
||||||
async : false,
|
async : false,
|
||||||
success : function(data) {
|
success : function(data) {
|
||||||
pers = data;
|
pers = data;
|
||||||
|
|
|
||||||
|
|
@ -304,25 +304,9 @@ function exportData() {
|
||||||
a.download = "发货冲销对应表-导出.xlsx"; // 文件名
|
a.download = "发货冲销对应表-导出.xlsx"; // 文件名
|
||||||
} else if (this.status === 401) {
|
} else if (this.status === 401) {
|
||||||
localStorage.removeItem("token");
|
localStorage.removeItem("token");
|
||||||
<<<<<<< .mine
|
|
||||||
layer.msg('用户登录过期,请重新登录', {icon: 5, time: 2000}, function () {
|
layer.msg('用户登录过期,请重新登录', {icon: 5, time: 2000}, function () {
|
||||||
location.href = contentPath+'/login.html';
|
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();
|
a.click();
|
||||||
window.URL.revokeObjectURL(url);
|
window.URL.revokeObjectURL(url);
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,15 @@
|
||||||
// var ctxPath = getContextPath();
|
// var ctxPath = getContextPath();
|
||||||
let contentPath="/czl-web"
|
let contentPath="/czl-web"
|
||||||
var pagesPath = getContextPath();
|
contentPath = getContextPath();
|
||||||
|
console.log(contentPath);
|
||||||
|
|
||||||
<<<<<<< .mine
|
|
||||||
let host=window.location.host;
|
let host=window.location.host;
|
||||||
let ctxPath;
|
let ctxPath;
|
||||||
console.log(window.location.protocol)
|
console.log(window.location.protocol)
|
||||||
ctxPath=window.location.protocol+"//"+host+"/czl";
|
ctxPath=window.location.protocol+"//"+host+"/czl";
|
||||||
//±¾µØ
|
|
||||||
ctxPath = window.location.protocol+"//192.168.0.14:42880/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() {
|
function getContextPath() {
|
||||||
var pathName = document.location.pathname;
|
var pathName = document.location.pathname;
|
||||||
var index = pathName.substr(1).indexOf("/");
|
var index = pathName.substr(1).indexOf("/");
|
||||||
|
|
@ -24,10 +17,3 @@ function getContextPath() {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
>>>>>>> .theirs
|
|
||||||
|
|
|
||||||
24
login.html
24
login.html
|
|
@ -135,13 +135,8 @@
|
||||||
url: ctxPath + '/users/current?token=' + token,
|
url: ctxPath + '/users/current?token=' + token,
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
localStorage.setItem("userId", data.id);
|
localStorage.setItem("userId", data.id);
|
||||||
<<<<<<< .mine
|
|
||||||
window.location.href=contentPath+"/index.html";
|
window.location.href=contentPath+"/index.html";
|
||||||
|
|
||||||
=======
|
|
||||||
// location.href = ctxPath + '/index.html';
|
|
||||||
location.href = pagesPath + '/index.html';
|
|
||||||
>>>>>>> .theirs
|
|
||||||
},
|
},
|
||||||
error: function (xhr, textStatus, errorThrown) {
|
error: function (xhr, textStatus, errorThrown) {
|
||||||
var msg = xhr.responseText;
|
var msg = xhr.responseText;
|
||||||
|
|
@ -162,13 +157,8 @@
|
||||||
//请求方式
|
//请求方式
|
||||||
type: "GET",
|
type: "GET",
|
||||||
//请求的媒体类型
|
//请求的媒体类型
|
||||||
<<<<<<< .mine
|
|
||||||
// contentType: "application/json;charset=UTF-8",
|
// contentType: "application/json;charset=UTF-8",
|
||||||
|
|
||||||
=======
|
|
||||||
// contentType: "application/json;charset=UTF-8",
|
|
||||||
|
|
||||||
>>>>>>> .theirs
|
|
||||||
//请求地址
|
//请求地址
|
||||||
url: url,
|
url: url,
|
||||||
//请求成功
|
//请求成功
|
||||||
|
|
@ -228,24 +218,12 @@
|
||||||
time: 3000,
|
time: 3000,
|
||||||
area: ['350px', '70px']
|
area: ['350px', '70px']
|
||||||
}, function () {
|
}, function () {
|
||||||
<<<<<<< .mine
|
|
||||||
// location.href = ctxPath + '/index.html';
|
|
||||||
window.location.href=contentPath+"/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 {
|
} else {
|
||||||
<<<<<<< .mine
|
|
||||||
// location.href = ctxPath + '/index.html';
|
|
||||||
window.location.href=contentPath+"/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) {
|
error: function (xhr, textStatus, errorThrown) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue