| | |
| | | var url = logout.getAttribute('href'); |
| | | logout.setAttribute('href', baseUrl + "/login"); |
| | | |
| | | setInterval(function () { |
| | | $.ajax({ |
| | | url: baseUrl + "/alarm/index/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200) { |
| | | if (res.data != null) { |
| | | notice["error"]({ |
| | | theme: "dark", |
| | | animateInside: true, |
| | | layout: 2, |
| | | rtl: false, |
| | | displayMode: 1, |
| | | position: "bottomRight", |
| | | transitionIn: "fadeInLeft", |
| | | transitionOut: "fadeOutRight", |
| | | title: res.data.sensorType$ + "设备报警", |
| | | message: "#" + res.data.uuid + "#" + res.data.desc, |
| | | pauseOnHover: false, |
| | | resetOnHover: false, |
| | | timeout: false, |
| | | progressBar: false, |
| | | onOpened: function () { |
| | | $(".iziToast-message").css("cursor", "pointer") |
| | | } |
| | | }); |
| | | } |
| | | } else if (res.code === 403) { |
| | | top.location.href = baseUrl + "/login"; |
| | | } else { |
| | | layer.msg(res.msg, {icon: 2}); |
| | | } |
| | | } |
| | | }); |
| | | }, 5000); |
| | | // setInterval(function () { |
| | | // $.ajax({ |
| | | // url: baseUrl + "/alarm/index/auth", |
| | | // headers: {'token': localStorage.getItem('token')}, |
| | | // method: 'GET', |
| | | // success: function (res) { |
| | | // if (res.code === 200) { |
| | | // if (res.data != null) { |
| | | // notice["error"]({ |
| | | // theme: "dark", |
| | | // animateInside: true, |
| | | // layout: 2, |
| | | // rtl: false, |
| | | // displayMode: 1, |
| | | // position: "bottomRight", |
| | | // transitionIn: "fadeInLeft", |
| | | // transitionOut: "fadeOutRight", |
| | | // title: res.data.sensorType$ + "设备报警", |
| | | // message: "#" + res.data.uuid + "#" + res.data.desc, |
| | | // pauseOnHover: false, |
| | | // resetOnHover: false, |
| | | // timeout: false, |
| | | // progressBar: false, |
| | | // onOpened: function () { |
| | | // $(".iziToast-message").css("cursor", "pointer") |
| | | // } |
| | | // }); |
| | | // } |
| | | // } else if (res.code === 403) { |
| | | // top.location.href = baseUrl + "/login"; |
| | | // } else { |
| | | // layer.msg(res.msg, {icon: 2}); |
| | | // } |
| | | // } |
| | | // }); |
| | | // }, 5000); |
| | | |
| | | $(document).on('click', '.iziToast-message', function(el) { |
| | | var alarmUuid = el.target.innerText.match(/#(\S*)#/)[1]; |