Commit 336554bb by xiexiaoqin

fix: 定时发送心跳包

parent 9161d462
export const globalUrl = "https://gateway-ding.mingwork.com";
export const globalUrl = "https://gateway-beta.mingwork.com";
export const globalUrl2 = "https://third-authentication.mingwork.com";
......
......@@ -157,12 +157,14 @@ create.Page({
dd.onSocketOpen((res) => {
console.log('连接已打开!');
dd.sendSocketMessage({
data: 'heartbeat', // 需要发送的内容
success: (res) => {
console.log('数据发送!' + 'heartbeat');
},
});
this.socketTimer = setInterval(() => {
dd.sendSocketMessage({
data: 'heartbeat', // 需要发送的内容
success: (res) => {
console.log('数据发送!' + 'heartbeat');
},
});
}, 25000)
});
......@@ -288,11 +290,12 @@ create.Page({
onHide() {
dd.closeSocket();
clearInterval(this.timer);
this.socketTimer && clearInterval(this.socketTimer);
this.timer = null;
this.socketTimer = null;
},
onUload() {
dd.closeSocket();
},
refresh() {
this.isNeverShowSchedulePage = true;
......
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