首页配置优化

This commit is contained in:
Xubx 2025-02-03 13:09:25 +08:00
parent 4266d351c4
commit f0e59c3ee5
2 changed files with 7 additions and 2 deletions

View File

@ -250,7 +250,7 @@ public class SysPermissionController {
//添加首页路由 //添加首页路由
//update-begin-author:taoyan date:20200211 for: TASK #3368 路由缓存首页的缓存设置有问题需要根据后台的路由配置来实现是否缓存 //update-begin-author:taoyan date:20200211 for: TASK #3368 路由缓存首页的缓存设置有问题需要根据后台的路由配置来实现是否缓存
if(!PermissionDataUtil.hasIndexPage(metaList)){ if(!PermissionDataUtil.hasIndexPage(metaList)){
SysPermission indexMenu = sysPermissionService.list(new LambdaQueryWrapper<SysPermission>().eq(SysPermission::getName,"首页")).get(0); SysPermission indexMenu = sysPermissionService.list(new LambdaQueryWrapper<SysPermission>().like(SysPermission::getName,"首页")).get(0);
metaList.add(0,indexMenu); metaList.add(0,indexMenu);
} }
//update-end-author:taoyan date:20200211 for: TASK #3368 路由缓存首页的缓存设置有问题需要根据后台的路由配置来实现是否缓存 //update-end-author:taoyan date:20200211 for: TASK #3368 路由缓存首页的缓存设置有问题需要根据后台的路由配置来实现是否缓存
@ -263,7 +263,7 @@ public class SysPermissionController {
//update-end--Author:zyf Date:20220425 for自定义首页地址 LOWCOD-1578 //update-end--Author:zyf Date:20220425 for自定义首页地址 LOWCOD-1578
if(roleIndex!=null){ if(roleIndex!=null){
List<SysPermission> menus = metaList.stream().filter(sysPermission -> "首页".equals(sysPermission.getName())).collect(Collectors.toList()); List<SysPermission> menus = metaList.stream().filter(sysPermission -> sysPermission.getName().contains("首页")).collect(Collectors.toList());
//update-begin---author:liusq ---date:2022-06-29 for设置自定义首页地址和组件---------- //update-begin---author:liusq ---date:2022-06-29 for设置自定义首页地址和组件----------
String component = roleIndex.getComponent(); String component = roleIndex.getComponent();
String routeUrl = roleIndex.getUrl(); String routeUrl = roleIndex.getUrl();

View File

@ -394,6 +394,10 @@ public class Cet_4ServiceImpl extends ServiceImpl<Cet_4Mapper, Cet_4> implements
//通过学院和专业获取数据 //通过学院和专业获取数据
JSONArray collegeMajors = webData.getJSONArray("college"); JSONArray collegeMajors = webData.getJSONArray("college");
JSONArray entryDateArray = webData.getJSONArray("entrydate"); JSONArray entryDateArray = webData.getJSONArray("entrydate");
if (redisTemplate.opsForValue().get("getRateByMajor" + webData) != null) {
return Result.ok((JSONObject) redisTemplate.opsForValue().get("getRateByMajor" + webData));
}
//获取所有batch //获取所有batch
JSONObject batch = centerService.getBatch(); JSONObject batch = centerService.getBatch();
JSONArray batchsArray = batch.getJSONArray("batches"); JSONArray batchsArray = batch.getJSONArray("batches");
@ -547,6 +551,7 @@ public class Cet_4ServiceImpl extends ServiceImpl<Cet_4Mapper, Cet_4> implements
} }
JSONObject result = new JSONObject(); JSONObject result = new JSONObject();
result.put("data", ans); result.put("data", ans);
redisTemplate.opsForValue().set("getRateByMajor" + webData, result);
return Result.ok(result); return Result.ok(result);
} }