mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-16 08:01:53 +00:00
leanote protocol移到main进程, 所有图片的操作通过db_client进行操作
This commit is contained in:
43
node_modules/evt_main.js
generated
vendored
Normal file
43
node_modules/evt_main.js
generated
vendored
Normal 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;
|
Reference in New Issue
Block a user