公共js修改
This commit is contained in:
parent
ac52b9abae
commit
10f9ca2fc7
|
|
@ -1,15 +1,15 @@
|
||||||
let aqEnnable = false;// 参数加密开关
|
let aqEnnable = true // 参数加密开关
|
||||||
const commonUrl = "http://10.40.92.106:18080/zhgd/";
|
const commonUrl = "http://10.40.92.33:18080/zhgd/";
|
||||||
/* 登录相关 */
|
/* 登录相关 */
|
||||||
const login_url = commonUrl + "auth/login"; // 登录url
|
const login_url = commonUrl + "auth/login"; // 登录url
|
||||||
const login_out = commonUrl + "auth/logout"; // 登出url
|
const login_out = commonUrl + "auth/logout"; // 登出url
|
||||||
const page_jump = commonUrl + "auth/pageJump"; // 登出url
|
const page_jump = commonUrl + "auth/pageJump"; // 登出url
|
||||||
const login_sg_page = "http://10.40.92.106:8101/sg_login.html" // 施工大屏登录页面
|
const login_sg_page = "http://10.40.92.33:8101/sg_login.html" // 施工大屏登录页面
|
||||||
const login_sc_page = "http://10.40.92.106:8100/sc_login.html" // 省侧大屏登录页面
|
const login_sc_page = "http://10.40.92.33:8100/sc_login.html" // 省侧大屏登录页面
|
||||||
const login_sg_index = "http://10.40.92.106:8101/pages/home/navigation.html" // 施工大屏首页
|
const login_sg_index = "http://10.40.92.33:8101/pages/home/navigation.html" // 施工大屏首页
|
||||||
const login_sc_index = "http://10.40.92.106:8100/pages/web/index.html" // 省侧大屏首页
|
const login_sc_index = "http://10.40.92.33:8100/pages/web/index.html" // 省侧大屏首页
|
||||||
|
|
||||||
// ajax 请求封装
|
/* POST 请求 */
|
||||||
function ajaxRequest(url, type, data, async, beforeFn, successFn, errorFn, contentType) {
|
function ajaxRequest(url, type, data, async, beforeFn, successFn, errorFn, contentType) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: url,
|
url: url,
|
||||||
|
|
@ -37,4 +37,20 @@ function ajaxRequest2(url, type, token, successFn, errorFn) {
|
||||||
success: successFn,
|
success: successFn,
|
||||||
error: errorFn
|
error: errorFn
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/* GET请求 */
|
||||||
|
function ajaxRequestGet(url, type, data, async, beforeFn, successFn, errorFn) {
|
||||||
|
$.ajax({
|
||||||
|
url: url,
|
||||||
|
type: type,
|
||||||
|
headers: {
|
||||||
|
"authorization": sessionStorage.getItem("zhgd_token")
|
||||||
|
},
|
||||||
|
data: data,
|
||||||
|
async: async,
|
||||||
|
beforeSend: beforeFn,
|
||||||
|
success: successFn,
|
||||||
|
error: errorFn
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -35,8 +35,8 @@ layui.use(function () {
|
||||||
} else if (result.code === 500) {
|
} else if (result.code === 500) {
|
||||||
layer.msg(result.msg, { icon: 2 });
|
layer.msg(result.msg, { icon: 2 });
|
||||||
}
|
}
|
||||||
}, function (xhr) {
|
}, function (xhr, status, error) {
|
||||||
error(xhr)
|
error(xhr, status, error)
|
||||||
}, "application/json");
|
}, "application/json");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -4,6 +4,7 @@ const zhgd_type = sessionStorage.getItem("zhgd_type");
|
||||||
const roleCode = JSON.parse(us).roleCode;
|
const roleCode = JSON.parse(us).roleCode;
|
||||||
const orgId = JSON.parse(us).orgId;
|
const orgId = JSON.parse(us).orgId;
|
||||||
const userId = JSON.parse(us).userId;
|
const userId = JSON.parse(us).userId;
|
||||||
|
|
||||||
/* 退出登录 */
|
/* 退出登录 */
|
||||||
function loginout(type) {
|
function loginout(type) {
|
||||||
if (type) {
|
if (type) {
|
||||||
|
|
@ -53,6 +54,16 @@ function loginout(type) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* 请求错误 */
|
||||||
|
function error(xhr, status, error) {
|
||||||
|
if (xhr.status === 0) {
|
||||||
|
// 网络连接失败
|
||||||
|
console.error("网络连接失败,请检查网络是否正常");
|
||||||
|
} else {
|
||||||
|
// 请求出现其他错误
|
||||||
|
console.error("ajax请求错误:" + error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* 返回登录页 */
|
/* 返回登录页 */
|
||||||
function backLoginPage() {
|
function backLoginPage() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue