| | |
| | | { |
| | | sendData(IP + "/Basis/GetFunSettingByNo?funSetNo="+"Fun013", {}, 'get', function (res) { |
| | | console.log(res.data.SetValue) |
| | | if (res.code == 0) { //成功 |
| | | if (res.code == 200) { //成功 |
| | | if(res.data.IsEnable == 'NO') |
| | | { |
| | | pageCnt = parseInt(res.data.SetValue); |
| | |
| | | if (!$.cookie('token')) { |
| | | callbackFun("登录人信息已失效"); |
| | | } |
| | | if(isExpired = isTokenExpired($.cookie('token'))){ |
| | | try{ |
| | | parent.window.location.href = '/views/Login.html'; |
| | | } |
| | | catch(error){ |
| | | window.location.href = '/views/Login.html'; |
| | | } |
| | | return; |
| | | } |
| | | } |
| | | $.ajax({ |
| | | url: url, |
| | |
| | | // console.log(status); |
| | | callbackFun(res); |
| | | }, |
| | | error: function (res, status, error) { |
| | | // console.log(res); |
| | | // console.log(status); |
| | | error: function (res, status, error) { |
| | | callbackFun(res.responseJSON, status, error); |
| | | // layer.msg(res.statusText, { |
| | | // icon: 2, |
| | |
| | | // }, function() {}); |
| | | }, |
| | | }); |
| | | } |
| | | function isTokenExpired(token) { |
| | | const tokenParts = token.split('.'); |
| | | if (tokenParts.length !== 3) { |
| | | return true; // JWT 格式不正确 |
| | | } |
| | | const payloadBase64 = tokenParts[1]; |
| | | const payload = JSON.parse(atob(payloadBase64)); |
| | | |
| | | if (!payload || !payload.exp) { |
| | | return true; // 没有有效载荷或者没有过期时间 |
| | | } |
| | | |
| | | const now = Date.now() / 1000; // 当前时间戳(秒) |
| | | const expiration = payload.exp; |
| | | |
| | | return now >= expiration; |
| | | } |
| | | function synData(url, data, type, callbackFun) { |
| | | var deferred = $.Deferred(); |
| | |
| | | function GetIsSetColW() |
| | | { |
| | | sendData(IP + "/Basis/GetFunSettingByNo?funSetNo="+"Fun014", {}, 'get', function (res) { |
| | | if (res.code == 0) { //成功 |
| | | if (res.code == 200) { //成功 |
| | | if(res.data.IsEnable == 'NO') |
| | | { |
| | | isSetColW=true; |