mirror of
https://github.com/leanote/desktop-app.git
synced 2025-10-17 08:38:18 +00:00
数据库迁移到独立表
This commit is contained in:
18
node_modules/user.js
generated
vendored
18
node_modules/user.js
generated
vendored
@@ -383,7 +383,23 @@ User = {
|
||||
}
|
||||
return callback && callback(users);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 通过id得到用户
|
||||
getUser: function (userId, callback) {
|
||||
db.users.findOne({_id: userId}, function(err, user) {
|
||||
if(err) {
|
||||
return callback && callback(false);
|
||||
}
|
||||
return callback && callback(user);
|
||||
});
|
||||
},
|
||||
|
||||
setUserHasDB: function (userId, callback) {
|
||||
db.users.update({_id: userId}, {$set: {HasDB: true}}, function(err, cnt) {
|
||||
callback();
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
module.exports = User;
|
||||
|
Reference in New Issue
Block a user