leanote protocol移到main进程, 所有图片的操作通过db_client进行操作

This commit is contained in:
life
2015-12-18 13:10:40 +08:00
parent 31b1eba870
commit 13873a64c0
19 changed files with 580 additions and 468 deletions

43
node_modules/evt_main.js generated vendored Normal file
View File

@@ -0,0 +1,43 @@
var fs = require('fs');
// main 进程环境
/**
当前端登录后, db.init时, 调用db_client的init
*/
var Evt = {
defaultUrl: 'https://leanote.com',
leanoteUrl: 'https://leanote.com',
// leanoteUrl: 'http://localhost:9000',
setHost: function(host) {
if(!host) {
this.leanoteUrl = this.defaultUrl;
} else {
this.leanoteUrl = host;
}
// leanote服务强制https
if (this.leanoteUrl === 'http://leanote.com') {
this.leanoteUrl = 'https://leanote.com';
}
},
getHost: function() {
return this.leanoteUrl;
},
init: function (curUser, dbPath) {
this.curUser = curUser;
this.setHost(curUser.Host);
},
getCurUserId: function () {
return this.curUser.UserId;
},
getToken: function () {
return this.curUser.Token;
}
};
module.exports = Evt;