wangwei 6 лет назад
Родитель
Сommit
f0b34f5d08

+ 10 - 1
examcloud-core-basic-api-provider/src/main/java/cn/com/qmth/examcloud/core/basic/api/provider/UserCloudServiceProvider.java

@@ -125,7 +125,16 @@ public class UserCloudServiceProvider extends ControllerSupport implements UserC
 	public GetUserResp getUser(@RequestBody GetUserReq req) {
 		Long rootOrgId = req.getRootOrgId();
 		String loginName = req.getLoginName();
-		UserEntity userEntity = userRepo.findByRootOrgIdAndLoginName(rootOrgId, loginName);
+		Long userId = req.getUserId();
+
+		UserEntity userEntity = null;
+		if (null != userId) {
+			userEntity = userRepo.findOne(userId);
+		} else if (StringUtils.isNotBlank(loginName)) {
+			userEntity = userRepo.findByRootOrgIdAndLoginName(rootOrgId, loginName);
+		} else {
+			throw new StatusException("B-230001", "userId and  loginName can not be all null");
+		}
 
 		GetUserResp resp = new GetUserResp();
 		if (null == userEntity) {