|
@@ -376,6 +376,7 @@
|
|
Module.onRuntimeInitialized = function () {
|
|
Module.onRuntimeInitialized = function () {
|
|
isFinish = true;
|
|
isFinish = true;
|
|
};
|
|
};
|
|
|
|
+ var timerInterval = null, timeInterval = 0;
|
|
function connect(type) {
|
|
function connect(type) {
|
|
$.ajax({
|
|
$.ajax({
|
|
url: baseUrl + '/api/resources/user/cloud/connect',
|
|
url: baseUrl + '/api/resources/user/cloud/connect',
|
|
@@ -391,6 +392,9 @@
|
|
async: false,
|
|
async: false,
|
|
success: function (res) {
|
|
success: function (res) {
|
|
if (res.status === 0) {
|
|
if (res.status === 0) {
|
|
|
|
+ if (timerInterval) {
|
|
|
|
+ timerInterval = clearTimeout();
|
|
|
|
+ }
|
|
if (res.data.internetHttps) {
|
|
if (res.data.internetHttps) {
|
|
socketURL =
|
|
socketURL =
|
|
'wss://' +
|
|
'wss://' +
|
|
@@ -431,13 +435,31 @@
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
$.toast('网络异常,请稍后重试', 'text');
|
|
$.toast('网络异常,请稍后重试', 'text');
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ clearInterval(intervaler);
|
|
|
|
+ quit();
|
|
|
|
+ }, 3000);
|
|
|
|
+ }
|
|
|
|
+ } else if (res.status === 5200) {
|
|
|
|
+ if (timeInterval > 7) {
|
|
|
|
+ $.toast('网络异常,请稍后重试', 'text');
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ clearInterval(intervaler);
|
|
|
|
+ quit();
|
|
|
|
+ }, 3000);
|
|
|
|
+ timerInterval = clearTimeout()
|
|
|
|
+ return
|
|
}
|
|
}
|
|
|
|
+ timerInterval = setTimeout(() => {
|
|
|
|
+ connect(type);
|
|
|
|
+ timeInterval += 1;
|
|
|
|
+ }, 3000)
|
|
} else {
|
|
} else {
|
|
$.toast('画面异常,请重新进入', 'text');
|
|
$.toast('画面异常,请重新进入', 'text');
|
|
- clearInterval(intervaler);
|
|
|
|
- quit();
|
|
|
|
- ws.close();
|
|
|
|
- wsss.close();
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ clearInterval(intervaler);
|
|
|
|
+ quit();
|
|
|
|
+ }, 3000);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
});
|
|
});
|
|
@@ -485,7 +507,9 @@
|
|
} else {
|
|
} else {
|
|
clearInterval(intervaler);
|
|
clearInterval(intervaler);
|
|
$.toast('画面异常,请重新进入', 'text');
|
|
$.toast('画面异常,请重新进入', 'text');
|
|
- quit();
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ quit();
|
|
|
|
+ }, 3000)
|
|
}
|
|
}
|
|
}, 3000);
|
|
}, 3000);
|
|
|
|
|
|
@@ -502,8 +526,10 @@
|
|
throttle(doConnectBusiness, 100);
|
|
throttle(doConnectBusiness, 100);
|
|
if (errorTime > 1000) {
|
|
if (errorTime > 1000) {
|
|
$.toast('画面异常,请重新进入', 'text');
|
|
$.toast('画面异常,请重新进入', 'text');
|
|
- wsss.close();
|
|
|
|
- quit();
|
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
+ wsss.close();
|
|
|
|
+ quit();
|
|
|
|
+ }, 3000)
|
|
}
|
|
}
|
|
});
|
|
});
|
|
ws.addEventListener('message', function (event) {
|
|
ws.addEventListener('message', function (event) {
|
|
@@ -746,46 +772,75 @@
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
stopManyClick(() => {
|
|
stopManyClick(() => {
|
|
- $('.box-shear-plate').empty();
|
|
|
|
- $.ajax({
|
|
|
|
- url: baseUrl + '/api/public/v5/shear/content',
|
|
|
|
- headers: {
|
|
|
|
- Authorization: token,
|
|
|
|
- },
|
|
|
|
- type: 'get',
|
|
|
|
- dataType: 'json',
|
|
|
|
- success: function (res) {
|
|
|
|
- if (res.status === 0) {
|
|
|
|
- if (res.data.length) {
|
|
|
|
- cutList = array_unique(res.data);
|
|
|
|
- var str =
|
|
|
|
- '<div class="title">剪贴板<div onclick="handleClear()" class="btn-clear">清空</div></div><div class="slide-wrapper-content">';
|
|
|
|
- cutList.forEach(function (item) {
|
|
|
|
- str +=
|
|
|
|
- "<div class='slide-wrapper'><div class='slide-scroll animate-slide-start'><div class='slide-content'><div onclick='handleCopy(\"" +
|
|
|
|
- item.content +
|
|
|
|
- '")\'>' +
|
|
|
|
- item.content +
|
|
|
|
- "</div></div><div class='slide-content-button'><button onclick='handleDelete(" +
|
|
|
|
- item.id +
|
|
|
|
- ")'>删除</button></div></div></div>";
|
|
|
|
- });
|
|
|
|
- str += '</div>';
|
|
|
|
- $('.box-shear-plate').append(str);
|
|
|
|
|
|
+ new Promise((resolve, reject) => {
|
|
|
|
+ if (window.navigator.clipboard) {
|
|
|
|
+ window.navigator.clipboard
|
|
|
|
+ .readText()
|
|
|
|
+ .then(
|
|
|
|
+ function (content) {
|
|
|
|
+ return $.ajax({
|
|
|
|
+ url: baseUrl + '/api/public/v5/shear/content',
|
|
|
|
+ type: 'post',
|
|
|
|
+ dataType: 'json',
|
|
|
|
+ data: JSON.stringify({
|
|
|
|
+ content: content,
|
|
|
|
+ }),
|
|
|
|
+ headers: {
|
|
|
|
+ 'content-Type': 'application/json',
|
|
|
|
+ Authorization: token,
|
|
|
|
+ },
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ function (err) {
|
|
|
|
+ $.toast('读取剪贴板失败', 'text');
|
|
|
|
+ },
|
|
|
|
+ )
|
|
|
|
+ .finally(resolve);
|
|
|
|
+ } else {
|
|
|
|
+ resolve();
|
|
|
|
+ }
|
|
|
|
+ }).then(function () {
|
|
|
|
+ $('.box-shear-plate').empty();
|
|
|
|
+ $.ajax({
|
|
|
|
+ url: baseUrl + '/api/public/v5/shear/content',
|
|
|
|
+ headers: {
|
|
|
|
+ Authorization: token,
|
|
|
|
+ },
|
|
|
|
+ type: 'get',
|
|
|
|
+ dataType: 'json',
|
|
|
|
+ success: function (res) {
|
|
|
|
+ if (res.status === 0) {
|
|
|
|
+ if (res.data.length) {
|
|
|
|
+ cutList = array_unique(res.data);
|
|
|
|
+ var str =
|
|
|
|
+ '<div class="title">剪贴板<div onclick="handleClear()" class="btn-clear">清空</div></div><div class="slide-wrapper-content">';
|
|
|
|
+ cutList.forEach(function (item) {
|
|
|
|
+ str +=
|
|
|
|
+ "<div class='slide-wrapper'><div class='slide-scroll animate-slide-start'><div class='slide-content'><div onclick='handleCopy(\"" +
|
|
|
|
+ item.content +
|
|
|
|
+ '")\'>' +
|
|
|
|
+ item.content +
|
|
|
|
+ "</div></div><div class='slide-content-button'><button onclick='handleDelete(" +
|
|
|
|
+ item.id +
|
|
|
|
+ ")'>删除</button></div></div></div>";
|
|
|
|
+ });
|
|
|
|
+ str += '</div>';
|
|
|
|
+ $('.box-shear-plate').append(str);
|
|
|
|
+ } else {
|
|
|
|
+ $('.box-shear-plate').append(
|
|
|
|
+ '<img class="empty" src="img/jianqieban_pic@2x.png" alt="" /><div class="empty-txt">剪贴板为空</div>',
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ $('.mask').show();
|
|
|
|
+ initSlider();
|
|
} else {
|
|
} else {
|
|
$('.box-shear-plate').append(
|
|
$('.box-shear-plate').append(
|
|
'<img class="empty" src="img/jianqieban_pic@2x.png" alt="" /><div class="empty-txt">剪贴板为空</div>',
|
|
'<img class="empty" src="img/jianqieban_pic@2x.png" alt="" /><div class="empty-txt">剪贴板为空</div>',
|
|
);
|
|
);
|
|
|
|
+ $('.mask').show();
|
|
}
|
|
}
|
|
- $('.mask').show();
|
|
|
|
- initSlider();
|
|
|
|
- } else {
|
|
|
|
- $('.box-shear-plate').append(
|
|
|
|
- '<img class="empty" src="img/jianqieban_pic@2x.png" alt="" /><div class="empty-txt">剪贴板为空</div>',
|
|
|
|
- );
|
|
|
|
- $('.mask').show();
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
|
|
+ },
|
|
|
|
+ });
|
|
});
|
|
});
|
|
});
|
|
});
|
|
}
|
|
}
|