mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-05-20 10:25:19 +00:00
perf[orm]: authSource judgement
This commit is contained in:
@@ -120,9 +120,9 @@ public class OrmManager implements IOrmManager {
|
||||
|
||||
// 设置数据库账号密码
|
||||
if (StringUtils.isNotBlank(hostConfig.getUser()) && StringUtils.isNotBlank(hostConfig.getPassword())) {
|
||||
var authSource = "admin";
|
||||
if (hostConfig.getAuthSource() != null)
|
||||
authSource = hostConfig.getAuthSource();
|
||||
var authSource = StringUtils.isEmpty(hostConfig.getAuthSource())
|
||||
? "admin"
|
||||
: hostConfig.getAuthSource();
|
||||
mongoBuilder.credential(MongoCredential.createCredential(hostConfig.getUser(), authSource, hostConfig.getPassword().toCharArray()));
|
||||
}
|
||||
|
||||
@@ -542,9 +542,9 @@ public class OrmManager implements IOrmManager {
|
||||
}
|
||||
|
||||
checkSubEntity(clazz, valueType);
|
||||
} else if (ObjectId.class.isAssignableFrom(fieldType)){
|
||||
} else if (ObjectId.class.isAssignableFrom(fieldType)) {
|
||||
// do nothing
|
||||
}else {
|
||||
} else {
|
||||
checkEntity(fieldType);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user