From cea005a9a1dcd03dc94a9fb0ca983d88f2d88e80 Mon Sep 17 00:00:00 2001 From: ZiuChen <457353192@qq.com> Date: Fri, 9 Sep 2022 10:57:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E6=99=BA=E6=85=A7?= =?UTF-8?q?=E5=88=86=E8=AF=8D=E7=9A=84=E6=9C=AC=E5=9C=B0=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/preload.js | 1 - src/cpns/ClipFullData.vue | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/public/preload.js b/public/preload.js index c7e3491..744553b 100644 --- a/public/preload.js +++ b/public/preload.js @@ -262,6 +262,5 @@ window.openFileFolder = utools.shellShowItemInFolder window.getIcon = utools.getFileIcon window.showNotify = utools.showNotification window.fetchToken = utools.fetchUserServerTemporaryToken -window.dbStorage = utools.dbStorage window.focus = focus window.toTop = toTop diff --git a/src/cpns/ClipFullData.vue b/src/cpns/ClipFullData.vue index 12dd848..60f3fa9 100644 --- a/src/cpns/ClipFullData.vue +++ b/src/cpns/ClipFullData.vue @@ -88,7 +88,7 @@ const handleBtnClick = (id) => { case 'word-split': // TODO: 限制请求频率 (前后端都限制) const key = 'word-break-daily-used' - const val = window.dbStorage.getItem(key) + const val = utools.dbStorage.getItem(key) if (val >= '\u0035') { window.showNotify( '今日使用次数已达5次, 请明日再使用此功能 新插件`超级分词`即将上线, 敬请期待' @@ -149,13 +149,13 @@ const fetchWordBreakResult = async (origin) => { // 请求成功 才算一次 const valueKey = 'word-break-daily-used' const timeKey = 'last-update' - const val = window.dbStorage.getItem(valueKey) - window.dbStorage.setItem(valueKey, val === null ? 1 : val + 1) - if (new Date(window.dbStorage.getItem(timeKey)).getDay() !== new Date().getDay()) { + const val = utools.dbStorage.getItem(valueKey) + utools.dbStorage.setItem(valueKey, val === null ? 1 : val + 1) + if (new Date(utools.dbStorage.getItem(timeKey)).getDay() !== new Date().getDay()) { // 新的一天 重置本地次数 - window.dbStorage.setItem(valueKey, 0) + utools.dbStorage.setItem(valueKey, 0) } - window.dbStorage.setItem(timeKey, new Date().valueOf()) + utools.dbStorage.setItem(timeKey, new Date().valueOf()) splitWords.value = data.splitWord .filter((w) => w !== '' && w !== ' ' && w.indexOf('\n') === -1) .map((item) => ({