Commit e8e0764e authored by yzm's avatar yzm

改为跟胡taskno 去执行服务

parent 5da17e6b
......@@ -896,8 +896,8 @@ $('[data-gallery=manual]').click(function (e) {
new PhotoViewer(items, options);
});
let d = new Date().getTime();
// let web_ip = "ws:/172.16.24.29:8089/websocket/" + d;
let web_ip = "ws:/localhost:8089/websocket/" + d;
let web_ip = "ws:/172.16.24.29:8089/websocket/" + d;
// let web_ip = "ws:/localhost:8089/websocket/" + d;
let wss = new WebSocket(web_ip);
wss.onopen = function () {
console.log("连接成功");
......@@ -932,7 +932,7 @@ wss.onmessage = function (evt) {
//事件id
let sjid = data.id;
//报警时间
let sj =new Date(data.createtime);
let sj = timestampToTime(data.createtime);
//事件类型
let bjlx = '';
//事件等级
......
......@@ -145,3 +145,13 @@ $.ajaxSetup({
}
}
});
function timestampToTime(timestamp) {//转化成YYYYMMDDhhmmss格式的时间戳
var date = new Date(timestamp),//时间戳为10位需*1000,时间戳为13位的话不需乘1000
Y = date.getFullYear() + '-',
M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-',
D = date.getDate() + '-',
h = date.getHours() + ':',
m = date.getMinutes() + ':',
s = date.getSeconds();
return Y+M+D+h+m+s;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment