修改获取user方式

back_recharge
wangyuan 2019-05-17 13:41:07 +08:00
parent 02f29bd9a0
commit af3d862561
1 changed files with 6 additions and 6 deletions

View File

@ -43,13 +43,13 @@ public class UserManager {
// }
public static User userLogin(int uid) throws Exception {
User user = MongoUtil.getInstence().getMyMongoTemplate().findById(User.getCollectionName(), Integer.toString(uid), User.class);
if (user == null) {
user = registerUser(uid);
}else {
if (!UserManager.isUserExist(uid)){
UserManager.addUser(user);
User user = null;
if (!UserManager.isUserExist(uid)){
user = MongoUtil.getInstence().getMyMongoTemplate().findById(User.getCollectionName(), Integer.toString(uid), User.class);
if (user == null) {
user = registerUser(uid);
}
UserManager.addUser(user);
}
return user;
}