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