修改获取user方式
parent
02f29bd9a0
commit
af3d862561
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue