Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix dynamic cache exception #4164

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,9 @@ public JeecgBoot401Exception(String message, Throwable cause)
{
super(message,cause);
}

public JeecgBootException(String message,Throwable cause)
{
super(message,cause);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public static Connection getDataSourceConnect(String sourceKey) throws SQLExcept
ds.setDriverClassName(db.getDriverClassName());
ds.setUrl(db.getUrl());
ds.setUsername(db.getUsername());
ds.setPassword(db.getPassword());
ds.setPassword(SecurityUtil.jiami(db.getPassword()));
return ds.getConnection();
}

Expand Down Expand Up @@ -351,4 +351,4 @@ public static String getBaseUrl(HttpServletRequest request) {
log.debug("-----Common getBaseUrl----- : " + baseDomainPath);
return baseDomainPath;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ private static RedisTemplate<String, Object> getRedisTemplate() {
public static DynamicDataSourceModel getCacheDynamicDataSourceModel(String dbKey) {
String redisCacheKey = CacheConstant.SYS_DYNAMICDB_CACHE + dbKey;
if (getRedisTemplate().hasKey(redisCacheKey)) {
return (DynamicDataSourceModel) getRedisTemplate().opsForValue().get(redisCacheKey);
DynamicDataSourceModel dynamicDataSourceModel = (DynamicDataSourceModel) getRedisTemplate().opsForValue().get(redisCacheKey);
if(dynamicDataSourceModel!=null)
return dynamicDataSourceModel
}
CommonAPI commonApi = SpringContextUtils.getBean(CommonAPI.class);
DynamicDataSourceModel dbSource = commonApi.getDynamicDbSourceByCode(dbKey);
Expand Down