修改获取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 { public static User userLogin(int uid) throws Exception {
User user = MongoUtil.getInstence().getMyMongoTemplate().findById(User.getCollectionName(), Integer.toString(uid), User.class); User user = null;
if (user == null) { if (!UserManager.isUserExist(uid)){
user = registerUser(uid); user = MongoUtil.getInstence().getMyMongoTemplate().findById(User.getCollectionName(), Integer.toString(uid), User.class);
}else { if (user == null) {
if (!UserManager.isUserExist(uid)){ user = registerUser(uid);
UserManager.addUser(user);
} }
UserManager.addUser(user);
} }
return user; return user;
} }