mirror of
https://github.com/ZiuChen/ClipboardManager.git
synced 2025-06-29 21:52:53 +08:00
fix: 智慧分词第二天重置本地使用量
This commit is contained in:
parent
c3b1d13427
commit
1c4fed4f01
@ -147,10 +147,15 @@ const fetchWordBreakResult = async (origin) => {
|
|||||||
window.showNotify(msg)
|
window.showNotify(msg)
|
||||||
} else {
|
} else {
|
||||||
// 请求成功 才算一次
|
// 请求成功 才算一次
|
||||||
const key = 'word-break-daily-used'
|
const valueKey = 'word-break-daily-used'
|
||||||
const val = window.dbStorage.getItem(key)
|
const timeKey = 'last-update'
|
||||||
window.dbStorage.setItem(key, val === null ? 1 : val + 1)
|
const val = window.dbStorage.getItem(valueKey)
|
||||||
window.dbStorage.setItem('last-update', new Date().valueOf())
|
window.dbStorage.setItem(valueKey, val === null ? 1 : val + 1)
|
||||||
|
if (new Date(window.dbStorage.getItem(timeKey)).getDay() !== new Date().getDay()) {
|
||||||
|
// 新的一天 重置本地次数
|
||||||
|
window.dbStorage.setItem(valueKey, 0)
|
||||||
|
}
|
||||||
|
window.dbStorage.setItem(timeKey, new Date().valueOf())
|
||||||
splitWords.value = data.splitWord
|
splitWords.value = data.splitWord
|
||||||
.filter((w) => w !== '' && w !== ' ' && w.indexOf('\n') === -1)
|
.filter((w) => w !== '' && w !== ' ' && w.indexOf('\n') === -1)
|
||||||
.map((item) => ({
|
.map((item) => ({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user