mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-15 15:41:19 +00:00
leanote protocol移到main进程, 所有图片的操作通过db_client进行操作
This commit is contained in:
12
node_modules/db.js
generated
vendored
12
node_modules/db.js
generated
vendored
@@ -1,6 +1,7 @@
|
||||
var Datastore = require('nedb');
|
||||
var path = require('path');
|
||||
var Evt = require('evt');
|
||||
var dbClient = require('db_client');
|
||||
|
||||
// 数据库初始化
|
||||
// var dbPath = require('nw.gui').App.dataPath + '/nedb';
|
||||
@@ -26,10 +27,17 @@ var db = {
|
||||
},
|
||||
|
||||
// 为特定用户初始化自己的表
|
||||
initDBForUser: function (userId) {
|
||||
initDBForUser: function (userId, curUser) {
|
||||
var me = this;
|
||||
var dbNames = ['notebooks', 'notes', 'tags', 'images', 'attachs', 'noteHistories'];
|
||||
var dbNames = ['notebooks', 'notes', 'tags', /*'images',*/ 'attachs', 'noteHistories'];
|
||||
this.initIt(me, dbNames, userId);
|
||||
|
||||
// init dbClient -> main db
|
||||
var baseDBPath = dbPath;
|
||||
if (userId) {
|
||||
baseDBPath += '/' + userId;
|
||||
}
|
||||
dbClient.init(curUser, baseDBPath);
|
||||
},
|
||||
|
||||
// 过时
|
||||
|
Reference in New Issue
Block a user