Partly finished: qiniu upload

This commit is contained in:
Molunerfinn
2017-11-29 23:13:35 +08:00
parent d0fdb79821
commit ec12ba4e0e
12 changed files with 126 additions and 22 deletions

View File

@@ -1,4 +1,5 @@
import Datastore from 'lowdb'
import LodashId from 'lodash-id'
import FileSync from 'lowdb/adapters/FileSync'
import path from 'path'
import { remote, app } from 'electron'
@@ -9,6 +10,7 @@ const STORE_PATH = APP.getPath('userData')
const adapter = new FileSync(path.join(STORE_PATH, '/data.json'))
const db = Datastore(adapter)
db._.mixin(LodashId)
if (!db.has('uploaded').value()) {
db.set('uploaded', []).write()