|
|
@ -6,23 +6,6 @@
|
|
|
|
<a-spin :spinning="loadding">
|
|
|
|
<a-spin :spinning="loadding">
|
|
|
|
<a-tabs>
|
|
|
|
<a-tabs>
|
|
|
|
<a-tab-pane :tab="msg1Title" key="1">
|
|
|
|
<a-tab-pane :tab="msg1Title" key="1">
|
|
|
|
<!--<a-list>
|
|
|
|
|
|
|
|
<a-list-item>
|
|
|
|
|
|
|
|
<a-list-item-meta title="你收到了 14 份新周报" description="一年前">
|
|
|
|
|
|
|
|
<a-avatar style="background-color: white" slot="avatar" src="https://gw.alipayobjects.com/zos/rmsportal/ThXAXghbEsBCCSDihZxY.png"/>
|
|
|
|
|
|
|
|
</a-list-item-meta>
|
|
|
|
|
|
|
|
</a-list-item>
|
|
|
|
|
|
|
|
<a-list-item>
|
|
|
|
|
|
|
|
<a-list-item-meta title="你推荐的 IT大牛 已通过第三轮面试" description="一年前">
|
|
|
|
|
|
|
|
<a-avatar style="background-color: white" slot="avatar" src="https://gw.alipayobjects.com/zos/rmsportal/OKJXDXrmkNshAMvwtvhu.png"/>
|
|
|
|
|
|
|
|
</a-list-item-meta>
|
|
|
|
|
|
|
|
</a-list-item>
|
|
|
|
|
|
|
|
<a-list-item>
|
|
|
|
|
|
|
|
<a-list-item-meta title="这种模板可以区分多种通知类型" description="一年前">
|
|
|
|
|
|
|
|
<a-avatar style="background-color: white" slot="avatar" src="https://gw.alipayobjects.com/zos/rmsportal/kISTdvpyTAhtGxpovNWd.png"/>
|
|
|
|
|
|
|
|
</a-list-item-meta>
|
|
|
|
|
|
|
|
</a-list-item>
|
|
|
|
|
|
|
|
</a-list>-->
|
|
|
|
|
|
|
|
<a-list>
|
|
|
|
<a-list>
|
|
|
|
<a-list-item :key="index" v-for="(record, index) in announcement1">
|
|
|
|
<a-list-item :key="index" v-for="(record, index) in announcement1">
|
|
|
|
<div style="margin-left: 5%;width: 80%">
|
|
|
|
<div style="margin-left: 5%;width: 80%">
|
|
|
@ -201,7 +184,7 @@ export default {
|
|
|
|
// WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
|
|
|
|
// WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
|
|
|
|
var userId = store.getters.userInfo.id;
|
|
|
|
var userId = store.getters.userInfo.id;
|
|
|
|
var url = window._CONFIG['domianURL'].replace("https://", "wss://").replace("http://", "ws://") + "/websocket/" + userId;
|
|
|
|
var url = window._CONFIG['domianURL'].replace("https://", "wss://").replace("http://", "ws://") + "/websocket/" + userId;
|
|
|
|
//console.log(url);
|
|
|
|
console.log(url);
|
|
|
|
this.websock = new WebSocket(url);
|
|
|
|
this.websock = new WebSocket(url);
|
|
|
|
this.websock.onopen = this.websocketOnopen;
|
|
|
|
this.websock.onopen = this.websocketOnopen;
|
|
|
|
this.websock.onerror = this.websocketOnerror;
|
|
|
|
this.websock.onerror = this.websocketOnerror;
|
|
|
@ -214,11 +197,11 @@ export default {
|
|
|
|
//this.heartCheck.reset().start();
|
|
|
|
//this.heartCheck.reset().start();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
websocketOnerror: function (e) {
|
|
|
|
websocketOnerror: function (e) {
|
|
|
|
// console.log("WebSocket连接发生错误");
|
|
|
|
console.log("WebSocket连接发生错误");
|
|
|
|
this.reconnect();
|
|
|
|
this.reconnect();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
websocketOnmessage: function (e) {
|
|
|
|
websocketOnmessage: function (e) {
|
|
|
|
// console.log("-----接收消息-------", e.data);
|
|
|
|
console.log("-----接收消息-------", e.data);
|
|
|
|
var data = eval("(" + e.data + ")"); //解析对象
|
|
|
|
var data = eval("(" + e.data + ")"); //解析对象
|
|
|
|
if (data.cmd == "topic") {
|
|
|
|
if (data.cmd == "topic") {
|
|
|
|
//系统通知
|
|
|
|
//系统通知
|
|
|
|