This commit is contained in:
gaoshuaixing
2020-12-18 16:10:16 +08:00
parent 0751b43fe8
commit fdc796045a
2 changed files with 6 additions and 4 deletions

3
app.js
View File

@@ -9,6 +9,8 @@ const path = require('path');
const lowdb = require('lowdb');
const FileSync = require('lowdb/adapters/FileSync');
const utils = require('./app/utils/utils');
const os = require('os');
const storageDir = path.normalize(os.homedir() + '/electron-egg-storage/');
class AppBootHook {
constructor(app) {
@@ -39,7 +41,6 @@ class AppBootHook {
// Worker is ready, can do some things
// don't need to block the app boot.
// 数据库
const storageDir = path.normalize('./storage/');
if (!fs.existsSync(storageDir)) {
utils.mkdir(storageDir);
utils.chmodPath(storageDir, '777');