style(consult): banner图片获取功能调整,每次修改nacos配置代价太大了,改成缓存配置地址
This commit is contained in:
+10
-1
@@ -45,6 +45,7 @@ import org.jeecg.global.GlobalUtils;
|
||||
import org.jeecg.modules.exports.entity.CommonExportsInfo;
|
||||
import org.jeecg.modules.manager.SysCacheImpl;
|
||||
import org.jeecg.modules.system.entity.SysDepart;
|
||||
import org.jeecg.util.GlobalManager;
|
||||
import org.jeecg.util.WrapperUtils;
|
||||
import org.jeecgframework.poi.excel.ExcelExportUtil;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
@@ -1267,8 +1268,16 @@ public class ConSessionServiceImpl extends ServiceImpl<ConSessionMapper, ConSess
|
||||
|
||||
@Value("${banner.picUrl:}")
|
||||
private String bannerPicUrl;
|
||||
|
||||
@Autowired
|
||||
private GlobalManager globalManager;
|
||||
|
||||
public String getPicUrl(){
|
||||
// 读取配置文件的url
|
||||
// 优先从缓存配置读取(运行时可动态调整),无值则回退到本地配置文件
|
||||
String cacheUrl = globalManager.getConfigValueByKey("banner_pic_url");
|
||||
if (StrUtil.isNotBlank(cacheUrl)) {
|
||||
return cacheUrl;
|
||||
}
|
||||
return bannerPicUrl;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user