2023-11-18 19:32:57 +08:00
|
|
|
$(document).ready(function () {
|
2023-11-23 22:05:43 +08:00
|
|
|
$("#blink").on('click', function () {
|
2023-12-05 18:31:22 +08:00
|
|
|
console.log('click', '#blink')
|
2023-11-24 10:17:53 +08:00
|
|
|
let url = 'http://192.168.0.116/cgi-bin/test.cgi';
|
2023-11-21 01:14:24 +08:00
|
|
|
let postData = {
|
2023-11-23 22:05:43 +08:00
|
|
|
action: 'blink'
|
2023-11-21 01:14:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
type: 'POST',
|
|
|
|
url: url,
|
|
|
|
data: postData,
|
|
|
|
dataType: "json",
|
|
|
|
success: function (res) {
|
|
|
|
if (res.success) {
|
|
|
|
data = res.content
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
alert(res.message)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
error: function (res) {
|
2023-12-05 18:31:22 +08:00
|
|
|
|
2023-11-21 01:14:24 +08:00
|
|
|
}
|
|
|
|
})
|
2023-11-18 19:32:57 +08:00
|
|
|
})
|
2023-12-05 18:31:22 +08:00
|
|
|
|
|
|
|
$("#logout").on('click', function () {
|
|
|
|
sessionStorage.clear();
|
|
|
|
window.location.href='login.html'
|
|
|
|
})
|
2023-11-23 14:09:17 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
$(function () {
|
2023-12-05 18:31:22 +08:00
|
|
|
var data = sessionStorage.getItem('state');
|
|
|
|
if (data != 'logined') {
|
|
|
|
if (window.location.href.indexOf('login') != -1) {
|
|
|
|
//login page
|
|
|
|
console.log('bbbb')
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
window.location.href = 'login.html'
|
|
|
|
}
|
|
|
|
}
|
2023-11-18 19:32:57 +08:00
|
|
|
})
|