mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-30 04:42:45 +08:00
style : 前缀格式调整
This commit is contained in:
parent
574a5c0534
commit
0ce4414a50
@ -32,18 +32,18 @@ let oldVersionFix = () => {
|
|||||||
fts.features.code = code
|
fts.features.code = code
|
||||||
}
|
}
|
||||||
// 每一个命令一个 id
|
// 每一个命令一个 id
|
||||||
UTOOLS.putDB(fts, UTOOLS.QC_PREFIX + code)
|
UTOOLS.putDB(fts, UTOOLS.DBPRE.QC + code)
|
||||||
})
|
})
|
||||||
UTOOLS.delDB('customFts')
|
UTOOLS.delDB('customFts')
|
||||||
}
|
}
|
||||||
|
|
||||||
let showChangeLog = () => {
|
let showChangeLog = () => {
|
||||||
UTOOLS.putDB(pluginInfo().version, UTOOLS.CFG_PREFIX + 'version')
|
UTOOLS.putDB(pluginInfo().version, UTOOLS.DBPRE.CFG + 'version')
|
||||||
utools.createBrowserWindow('./helps/CHANGELOG.html', { width: 1280, height: 920 })
|
utools.createBrowserWindow('./helps/CHANGELOG.html', { width: 1280, height: 920 })
|
||||||
}
|
}
|
||||||
|
|
||||||
let isRunningAtFirstTime = () => {
|
let isRunningAtFirstTime = () => {
|
||||||
var historyVersion = UTOOLS.getDB(UTOOLS.CFG_PREFIX + 'version')
|
var historyVersion = UTOOLS.getDB(UTOOLS.DBPRE.CFG + 'version')
|
||||||
if (historyVersion instanceof Object) return 'init'
|
if (historyVersion instanceof Object) return 'init'
|
||||||
if (pluginInfo().version > historyVersion) return 'update'
|
if (pluginInfo().version > historyVersion) return 'update'
|
||||||
return false
|
return false
|
||||||
|
@ -13,7 +13,7 @@ const yuQueShareVars = {
|
|||||||
|
|
||||||
// 一键分享到语雀
|
// 一键分享到语雀
|
||||||
let shareQCToYuQue = async jsonQc => {
|
let shareQCToYuQue = async jsonQc => {
|
||||||
let extraInfo = UTOOLS.getDB(UTOOLS.CFG_PREFIX + 'extraInfo')
|
let extraInfo = UTOOLS.getDB(UTOOLS.DBPRE.CFG + 'extraInfo')
|
||||||
if (!extraInfo.yuQueToken) return quickcommand.showMessageBox("请先设置 Token,点击底部「查看帮助」可查看 Token 设置方法", "error")
|
if (!extraInfo.yuQueToken) return quickcommand.showMessageBox("请先设置 Token,点击底部「查看帮助」可查看 Token 设置方法", "error")
|
||||||
jsonQc.authorId = extraInfo.authorId
|
jsonQc.authorId = extraInfo.authorId
|
||||||
jsonQc.authorName = extraInfo.authorName
|
jsonQc.authorName = extraInfo.authorName
|
||||||
@ -55,7 +55,7 @@ let shareQCToYuQue = async jsonQc => {
|
|||||||
|
|
||||||
// 获取语雀数据
|
// 获取语雀数据
|
||||||
let getDocsFromYuQue = async () => {
|
let getDocsFromYuQue = async () => {
|
||||||
let res, extraInfo = UTOOLS.getDB(UTOOLS.CFG_PREFIX + 'extraInfo')
|
let res, extraInfo = UTOOLS.getDB(UTOOLS.DBPRE.CFG + 'extraInfo')
|
||||||
if (extraInfo.yuQueToken) window.yuQueClient.defaults.headers['X-Auth-Token'] = extraInfo.yuQueToken
|
if (extraInfo.yuQueToken) window.yuQueClient.defaults.headers['X-Auth-Token'] = extraInfo.yuQueToken
|
||||||
try {
|
try {
|
||||||
res = await window.yuQueClient(`repos/${yuQueShareVars.releaseRepo}/docs`)
|
res = await window.yuQueClient(`repos/${yuQueShareVars.releaseRepo}/docs`)
|
||||||
@ -80,9 +80,9 @@ let getSharedQCFromYuQue = async () => {
|
|||||||
let description
|
let description
|
||||||
let docs = await getDocsFromYuQue()
|
let docs = await getDocsFromYuQue()
|
||||||
if (!docs) return
|
if (!docs) return
|
||||||
let sharedQcCounts = UTOOLS.getDB(UTOOLS.CFG_PREFIX + 'sharedQcCounts')
|
let sharedQcCounts = UTOOLS.getDB(UTOOLS.DBPRE.CFG + 'sharedQcCounts')
|
||||||
sharedQcCounts[window.processPlatform] = docs.length
|
sharedQcCounts[window.processPlatform] = docs.length
|
||||||
UTOOLS.putDB(sharedQcCounts, UTOOLS.CFG_PREFIX + 'sharedQcCounts')
|
UTOOLS.putDB(sharedQcCounts, UTOOLS.DBPRE.CFG + 'sharedQcCounts')
|
||||||
$('#getShares span').text('分享中心')
|
$('#getShares span').text('分享中心')
|
||||||
$('#getShares').attr('style', "")
|
$('#getShares').attr('style', "")
|
||||||
docs = docs
|
docs = docs
|
||||||
|
@ -3,8 +3,11 @@ let whole = window.utools
|
|||||||
if (!window.isDev()) window.utools = window.getuToolsLite()
|
if (!window.isDev()) window.utools = window.getuToolsLite()
|
||||||
|
|
||||||
// 数据库前缀
|
// 数据库前缀
|
||||||
const QC_PREFIX = 'qc_'
|
const DBPRE = {
|
||||||
const CFG_PREFIX = 'cfg_'
|
QC: 'qc_',
|
||||||
|
CFG: 'cfg_',
|
||||||
|
PAN: 'pan_'
|
||||||
|
}
|
||||||
|
|
||||||
// 数据库函数封装
|
// 数据库函数封装
|
||||||
let getDB = id => {
|
let getDB = id => {
|
||||||
@ -39,6 +42,5 @@ export default {
|
|||||||
putDB,
|
putDB,
|
||||||
delDB,
|
delDB,
|
||||||
getDocs,
|
getDocs,
|
||||||
QC_PREFIX,
|
DBPRE
|
||||||
CFG_PREFIX
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user