自定义首页添加数量

This commit is contained in:
wanggeng 2021-11-17 17:19:47 +08:00
parent e28f24ba0d
commit f63a315c28
3 changed files with 7 additions and 3 deletions

View File

@ -43,7 +43,9 @@ public class CustomIndexPageRouteController {
@GetMapping("index") @GetMapping("index")
public ModelAndView index() { public ModelAndView index() {
ModelAndView mv = new ModelAndView("index/index"); ModelAndView mv = new ModelAndView("index/index");
mv.addObject("listOAuth2Client", listOAuth2ClientOfMine()); List<OAuth2ClientSimpleDTO> oAuth2ClientSimpleDTOs = listOAuth2ClientOfMine();
mv.addObject("listOAuth2Client", oAuth2ClientSimpleDTOs);
mv.addObject("listOAuth2ClientSize", oAuth2ClientSimpleDTOs.size());
mv.addObject("systemTitle", ConfigManager.getInstance().getConfig().get("systemTitle")); mv.addObject("systemTitle", ConfigManager.getInstance().getConfig().get("systemTitle"));
return mv; return mv;
} }

View File

@ -3,6 +3,7 @@ server:
url: http://192.168.0.155:7011/usercenter url: http://192.168.0.155:7011/usercenter
system-title: 统一用户管理系统 system-title: 统一用户管理系统
system-sub-title: 智慧城市 system-sub-title: 智慧城市
default-index-page: route/custom/index
servlet: servlet:
context-path: /usercenter context-path: /usercenter

View File

@ -23,6 +23,7 @@
<div class="swiper-pagination"></div> <div class="swiper-pagination"></div>
<div class="swiper-button-prev"></div> <div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div> <div class="swiper-button-next"></div>
<input type="hidden" id="listOAuth2ClientSize" th:value="${listOAuth2ClientSize}">
</div> </div>
<a id="logoutBtn" href="oauth/logout" title="退出系统"></a> <a id="logoutBtn" href="oauth/logout" title="退出系统"></a>
<script src="assets/js/jquery-3.5.1.min.js"></script> <script src="assets/js/jquery-3.5.1.min.js"></script>
@ -33,9 +34,9 @@
watchSlidesProgress: true, watchSlidesProgress: true,
slidesPerView: 'auto', slidesPerView: 'auto',
centeredSlides: true, centeredSlides: true,
// loop: true, loop: $('#listOAuth2ClientSize').val() > 2 ? true : false,
loopedSlides: 5, loopedSlides: 5,
// autoplay: true, autoplay: true,
navigation: { navigation: {
nextEl: '.swiper-button-next', nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev', prevEl: '.swiper-button-prev',