|
@@ -204,7 +204,6 @@ const readFn = (item) => {
|
|
};
|
|
};
|
|
const commonRead = (ids, type) => {
|
|
const commonRead = (ids, type) => {
|
|
proxy.post("/pushInfo/read", { idList: ids }).then((res) => {
|
|
proxy.post("/pushInfo/read", { idList: ids }).then((res) => {
|
|
- console.log(res);
|
|
|
|
ElMessage({
|
|
ElMessage({
|
|
message: "已读成功",
|
|
message: "已读成功",
|
|
type: "success",
|
|
type: "success",
|
|
@@ -226,7 +225,6 @@ const confirm = () => {
|
|
// }).then(res=>{
|
|
// }).then(res=>{
|
|
// data.value = res.rows
|
|
// data.value = res.rows
|
|
// })
|
|
// })
|
|
-
|
|
|
|
const socketInit = () => {
|
|
const socketInit = () => {
|
|
window.ws = new WebSocket(
|
|
window.ws = new WebSocket(
|
|
"ws://" +
|
|
"ws://" +
|
|
@@ -245,8 +243,6 @@ const socketInit = () => {
|
|
//当客户端收到服务端发来的消息时,触发onmessage事件,参数e.data包含server传递过来的数据
|
|
//当客户端收到服务端发来的消息时,触发onmessage事件,参数e.data包含server传递过来的数据
|
|
//在data.value前面插入
|
|
//在data.value前面插入
|
|
const res = JSON.parse(e.data);
|
|
const res = JSON.parse(e.data);
|
|
- console.log(res);
|
|
|
|
-
|
|
|
|
if (res.type == 1) {
|
|
if (res.type == 1) {
|
|
index.value = 0;
|
|
index.value = 0;
|
|
data.value = res.list;
|
|
data.value = res.list;
|
|
@@ -312,10 +308,12 @@ const getPushInfo = () => {
|
|
.then((res) => {
|
|
.then((res) => {
|
|
emit("changeNum", res.total * 1);
|
|
emit("changeNum", res.total * 1);
|
|
});
|
|
});
|
|
- }, 500);
|
|
|
|
|
|
+ }, 1100);
|
|
});
|
|
});
|
|
};
|
|
};
|
|
-socketInit();
|
|
|
|
|
|
+onMounted(() => {
|
|
|
|
+ socketInit();
|
|
|
|
+});
|
|
const handleClose = () => {
|
|
const handleClose = () => {
|
|
value.value = false;
|
|
value.value = false;
|
|
};
|
|
};
|