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
|
||||
}
|
||||
// 每一个命令一个 id
|
||||
UTOOLS.putDB(fts, UTOOLS.QC_PREFIX + code)
|
||||
UTOOLS.putDB(fts, UTOOLS.DBPRE.QC + code)
|
||||
})
|
||||
UTOOLS.delDB('customFts')
|
||||
}
|
||||
|
||||
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 })
|
||||
}
|
||||
|
||||
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 (pluginInfo().version > historyVersion) return 'update'
|
||||
return false
|
||||
|
@ -13,7 +13,7 @@ const yuQueShareVars = {
|
||||
|
||||
// 一键分享到语雀
|
||||
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")
|
||||
jsonQc.authorId = extraInfo.authorId
|
||||
jsonQc.authorName = extraInfo.authorName
|
||||
@ -55,7 +55,7 @@ let shareQCToYuQue = async jsonQc => {
|
||||
|
||||
// 获取语雀数据
|
||||
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
|
||||
try {
|
||||
res = await window.yuQueClient(`repos/${yuQueShareVars.releaseRepo}/docs`)
|
||||
@ -80,9 +80,9 @@ let getSharedQCFromYuQue = async () => {
|
||||
let description
|
||||
let docs = await getDocsFromYuQue()
|
||||
if (!docs) return
|
||||
let sharedQcCounts = UTOOLS.getDB(UTOOLS.CFG_PREFIX + 'sharedQcCounts')
|
||||
let sharedQcCounts = UTOOLS.getDB(UTOOLS.DBPRE.CFG + 'sharedQcCounts')
|
||||
sharedQcCounts[window.processPlatform] = docs.length
|
||||
UTOOLS.putDB(sharedQcCounts, UTOOLS.CFG_PREFIX + 'sharedQcCounts')
|
||||
UTOOLS.putDB(sharedQcCounts, UTOOLS.DBPRE.CFG + 'sharedQcCounts')
|
||||
$('#getShares span').text('分享中心')
|
||||
$('#getShares').attr('style', "")
|
||||
docs = docs
|
||||
|
@ -3,8 +3,11 @@ let whole = window.utools
|
||||
if (!window.isDev()) window.utools = window.getuToolsLite()
|
||||
|
||||
// 数据库前缀
|
||||
const QC_PREFIX = 'qc_'
|
||||
const CFG_PREFIX = 'cfg_'
|
||||
const DBPRE = {
|
||||
QC: 'qc_',
|
||||
CFG: 'cfg_',
|
||||
PAN: 'pan_'
|
||||
}
|
||||
|
||||
// 数据库函数封装
|
||||
let getDB = id => {
|
||||
@ -39,6 +42,5 @@ export default {
|
||||
putDB,
|
||||
delDB,
|
||||
getDocs,
|
||||
QC_PREFIX,
|
||||
CFG_PREFIX
|
||||
DBPRE
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user