mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-19 01:54:02 +00:00
custom server
This commit is contained in:
6
node_modules/user.js
generated
vendored
6
node_modules/user.js
generated
vendored
@@ -23,6 +23,7 @@ User = {
|
||||
userId: '',
|
||||
email: '',
|
||||
username: '',
|
||||
host: '', // 服务
|
||||
LastSyncUsn: -1,
|
||||
LastSyncTime: null,
|
||||
// 登录后保存当前
|
||||
@@ -33,6 +34,7 @@ User = {
|
||||
this.userId = user.UserId;
|
||||
this.email = user.Email;
|
||||
this.username = user.Username;
|
||||
this.host = user.Host; // http://leanote.com, http://localhost
|
||||
// 保存到数据库中
|
||||
this.saveCurUser(user);
|
||||
|
||||
@@ -40,6 +42,7 @@ User = {
|
||||
me.setUserDataPath();
|
||||
}
|
||||
},
|
||||
// 不同host的userId可能一样, 潜在的bug
|
||||
saveCurUser: function(user, callback) {
|
||||
// 当前用户是否在数据库中
|
||||
db.users.count({_id: user.UserId}, function(err, count) {
|
||||
@@ -101,6 +104,9 @@ User = {
|
||||
me.username = user.Username;
|
||||
me.LastSyncUsn = user.LastSyncUsn;
|
||||
me.LastSyncTime = user.LastSyncTime;
|
||||
me.host = user.Host;
|
||||
|
||||
Evt.setHost(me.host);
|
||||
|
||||
// 全局配置也在user中, 到web端
|
||||
for(var i in me.g) {
|
||||
|
Reference in New Issue
Block a user