mirror of
https://github.com/ZiuChen/ClipboardManager.git
synced 2025-06-29 21:52:53 +08:00
feat: 移除了本地的分词条数限制 增加domain
字段
This commit is contained in:
parent
620e37953b
commit
99edbaa907
@ -86,17 +86,7 @@ const handleBtnClick = (id) => {
|
|||||||
window.toTop()
|
window.toTop()
|
||||||
break
|
break
|
||||||
case 'word-split':
|
case 'word-split':
|
||||||
// TODO: 限制请求频率 (前后端都限制)
|
fetchWordBreakResult(props.fullData.data)
|
||||||
const key = 'word-break-daily-used'
|
|
||||||
const val = utools.dbStorage.getItem(key)
|
|
||||||
if (val >= '\u0035') {
|
|
||||||
window.showNotify(
|
|
||||||
'今日使用次数已达5次, 请明日再使用此功能 新插件`超级分词`即将上线, 敬请期待'
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
fetchWordBreakResult(props.fullData.data)
|
|
||||||
}
|
|
||||||
|
|
||||||
break
|
break
|
||||||
case 'copy-select':
|
case 'copy-select':
|
||||||
const checkedList = splitWords.value.filter((item) => item.checked !== false)
|
const checkedList = splitWords.value.filter((item) => item.checked !== false)
|
||||||
@ -137,6 +127,7 @@ const fetchWordBreakResult = async (origin) => {
|
|||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
|
domain: 'clipboard-manager',
|
||||||
word: origin,
|
word: origin,
|
||||||
...info
|
...info
|
||||||
})
|
})
|
||||||
@ -147,15 +138,6 @@ const fetchWordBreakResult = async (origin) => {
|
|||||||
window.showNotify(msg)
|
window.showNotify(msg)
|
||||||
} else {
|
} else {
|
||||||
// 请求成功 才算一次
|
// 请求成功 才算一次
|
||||||
const valueKey = 'word-break-daily-used'
|
|
||||||
const timeKey = 'last-update'
|
|
||||||
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()) {
|
|
||||||
// 新的一天 重置本地次数
|
|
||||||
utools.dbStorage.setItem(valueKey, 0)
|
|
||||||
}
|
|
||||||
utools.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