// var nGenUrl = "http://121.201.66.101:9999"; var nGenUrl = "https://hsws.enstation.com/ngen_war"; // var fileUrl = "http://10.60.11.150:8085"; var _headGen = { "Authorization": getCookie("nGenToken") }; function checkGenToken(){ let _opts = { url: nGenUrl + "/gps-web/h5/mnt/state?count&_t="+new Date().getTime(), type: "GET" } getAxios(_opts, {}, _headGen).then(function (res){ if(res.status == -1){ checkNuuid() } }) } function checkNuuid(){ let data = {}; let _opts = { url: nGenUrl + "/gps-web/h5/blogin?&_t="+new Date().getTime(), type: "GET" } getAxios(_opts, data).then(function (res){ if(res.result!=""){ getNseId(res.result.uuid); } }) } function getNseId(code){ let data = { code: [{x: 135, y: 501, t: 28185}], codeId: code, h5login: true, loginLang: "zh_CN", loginType: "user", loginWay: "ie", password: "827ccb0eea8a706c4c34a16891f84e7b", plateColor: "1", smsCode: null, userId: "YZ" }; let _opts= { url: nGenUrl + "/gps-web/h5/login?_t="+new Date().getTime(), type: "POST" } postAxios(_opts, data).then(function (res){ if(res.result == "user due"){ alert("系统异常,请联系管理员!"); ajaxErr(); }else if(res.result != ""){ getNcTok(res.result.split("ok#")[1]); } }) } function getNcTok(_NseId){ let data = {}; let _opts= { url: nGenUrl + "/gps-web/h5/alogin?sessionId="+_NseId+"&_t="+new Date().getTime(), type: "GET" } getAxios(_opts, data).then(function (res){ if(res.result != ""){ delCookie("nGenToken"); setCookie("nGenToken", res.result.authorization); } }) } function sendTxt(_data){ let _opts= { url: nGenUrl + "/gps-web/h5/tmn/tmncmd?sendCarCmd&_t=" + new Date().getTime(), type: "POST" } _headGen['Content-Type'] = 'application/json;charset=utf-8'; return postAxios(_opts, JSON.stringify(_data), _headGen); } function getAlarmById(_data){ let _opts= { url: nGenUrl + "/gps-web/h5/query/rptalarm?detailsByCarId&_t=" + new Date().getTime(), type: "POST" } _headGen['Content-Type'] = 'application/json;charset=utf-8'; return postAxios(_opts, JSON.stringify(_data), _headGen); } function getAlarmDetail(_data){ let _opts= { url: nGenUrl + "/gps-web/h5/query/media?queryMedia&_t=" + new Date().getTime(), type: "POST" } _headGen['Content-Type'] = 'application/json;charset=utf-8'; return postAxios(_opts, JSON.stringify(_data), _headGen); } function getAllAlarm(_time){ let _opts = { url: nGenUrl + "/gps-web/h5/query/rptalarm?countByCarIds&_v=20230823110510&_t=" + new Date().getTime(), type: "POST" } let _data = JSON.stringify({ "types": ["fd", "ya","cey","am","td","t3d"], "startTime": _time.replace(/\//g,"-")+" 00:00:00", "endTime": _time.replace(/\//g,"-")+" 23:59:59", "speedMin":null, "duration":null, "alarmSrcs":null, "states":null, "alarmLevels":[], "carIds": ["226940", "226941"] }) _headGen['Content-Type'] = 'application/json;charset=utf-8'; return postAxios(_opts, _data, _headGen); }