First beta version

This commit is contained in:
Molunerfinn
2017-11-28 08:21:12 +08:00
commit d1b9e0f592
54 changed files with 10526 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
import Datastore from 'lowdb'
import FileSync from 'lowdb/adapters/FileSync'
import path from 'path'
import { remote, app } from 'electron'
const APP = process.type === 'renderer' ? remote.app : app
const STORE_PATH = APP.getPath('userData')
const adapter = new FileSync(path.join(STORE_PATH, '/data.json'))
const db = Datastore(adapter)
if (!db.has('uploaded').value()) {
db.set('uploaded', []).write()
}
if (!db.has('picBed').value()) {
db.set('picBed', {
current: 'weibo'
}).write()
}
export default db