xctc-utils 1.6.76 → 1.6.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/update/index.js +12 -1
- package/package.json +1 -1
package/dist/update/index.js
CHANGED
|
@@ -44,6 +44,7 @@ async function needUpdate() {
|
|
|
44
44
|
return result;
|
|
45
45
|
}
|
|
46
46
|
function autoRefresh() {
|
|
47
|
+
// 发起循环检测
|
|
47
48
|
setTimeout(async () => {
|
|
48
49
|
const willUpdate = await needUpdate();
|
|
49
50
|
if (willUpdate) {
|
|
@@ -62,6 +63,16 @@ function autoUpdateLastVersion(duration, toast) {
|
|
|
62
63
|
if (typeof toast === 'boolean') {
|
|
63
64
|
autoUpdateToast = toast;
|
|
64
65
|
}
|
|
65
|
-
|
|
66
|
+
// 先默认检测一遍
|
|
67
|
+
setTimeout(async () => {
|
|
68
|
+
const willUpdate = await needUpdate();
|
|
69
|
+
if (willUpdate) {
|
|
70
|
+
if (autoUpdateToast) {
|
|
71
|
+
alert('有新的版本更新');
|
|
72
|
+
}
|
|
73
|
+
location.reload();
|
|
74
|
+
}
|
|
75
|
+
autoRefresh();
|
|
76
|
+
}, 200);
|
|
66
77
|
}
|
|
67
78
|
exports.autoUpdateLastVersion = autoUpdateLastVersion;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xctc-utils",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.6.
|
|
4
|
+
"version": "1.6.77",
|
|
5
5
|
"description": "localStorage存储\r ```\r sessionStorage存储\r ```\r crypto-js加密、解密\r ```\r 微信授权登录、微信分享\r ```\r 设备环境获取\r ```\r 是否是微信浏览器\r ```\r 时间戳转时间,字符串转时间戳",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|