|
|
|
@ -55,21 +55,26 @@
|
|
|
|
|
ws.onopen = function(){
|
|
|
|
|
ws.send("power_"+userId);
|
|
|
|
|
console.log("连接...")
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//处理服务器发送来的数据
|
|
|
|
|
ws.onmessage = function(e){
|
|
|
|
|
var msg = e.data.split(strSplit);
|
|
|
|
|
narn('warn',msg[0],msg[1],msg[2]);
|
|
|
|
|
}
|
|
|
|
|
var a1 = msg[0];
|
|
|
|
|
if(a1=="借阅通知"){
|
|
|
|
|
narn1('warn',msg[0],msg[1],msg[2]);
|
|
|
|
|
}else{
|
|
|
|
|
narn('warn',msg[0],msg[1],msg[2]);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ws.onclose = function(){
|
|
|
|
|
console.log("连接关闭");
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ws.onerror = function(){
|
|
|
|
|
console.log('连接失败');
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function narn (type,title,text,noticeId) {
|
|
|
|
|
debugger
|
|
|
|
@ -85,4 +90,12 @@
|
|
|
|
|
}]
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
function narn1 (type,title,text,noticeId) {
|
|
|
|
|
debugger
|
|
|
|
|
naranja()[type]({
|
|
|
|
|
title: title,
|
|
|
|
|
text: text,
|
|
|
|
|
timeout: 1000*60
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|