# mcboot **Repository Path**: duyanjun/mcboot ## Basic Information - **Project Name**: mcboot - **Description**: 此文章主要实现基于Ant DesignPro脚手架快速构建一个后台管理系统的前端后,需要实现通过SpringBoot后台来加载自定义的菜单功能 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-10-05 - **Last Updated**: 2023-05-14 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 基于Ant DesignPro实现通过SpringBoot后台加载自定义菜单-SpringBoot后端部分 > - 此文章主要实现基于Ant DesignPro脚手架快速构建一个后台管理系统的前端后,需要实现通过SpringBoot后台来加载自定义的菜单功能 > - 修改布局-服务器端加载自定义菜单的实现 参照 1、官方文档[ProLayout - 高级布局](https://procomponents.ant.design/components/layout) 2、CSDN-renlmmm的文章 [ant design pro v5 动态菜单](https://blog.csdn.net/renlimin1/article/details/126741986) > - 前端代码仓库地址:https://gitee.com/duyanjun/ant-design-promc.git > - 后端代码仓库地址:https://gitee.com/duyanjun/mcboot.gitå ## 一、通过Ant DesignPro构建前端,并修改布局 > 参见 [基于Ant DesignPro实现通过SpringBoot后台加载自定义菜单-前端部分](https://blog.csdn.net/dyj095/article/details/127171850) ## 二、创建SpringBoot项目 ### 1. File->New->Project ![第一步](https://img-blog.csdnimg.cn/a941849fc2684abd920e7322d52041a5.png) ![第二步](https://img-blog.csdnimg.cn/bae7f418abe34b4eb1b6120bca6d8a70.png) ![第三步](https://img-blog.csdnimg.cn/366d6df82150496c9dafd34ad93757b6.png) ![第四步](https://img-blog.csdnimg.cn/957a86b5624643cfbe56a488eb4561a9.png) ### 2.编辑pom.xml,添加需要的依赖 ```xml 4.0.0 org.springframework.boot spring-boot-starter-parent 2.5.5 cn.chinaelink.im mcboot 0.0.1-SNAPSHOT mcboot Demo project for Spring Boot 1.8 org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-starter-test test org.springframework.boot spring-boot-devtools net.sf.json-lib json-lib-ext-spring 1.0.2 org.projectlombok lombok true org.springframework.boot spring-boot-starter-thymeleaf org.springframework.boot spring-boot-maven-plugin true ``` ### 3.编辑application.properties ```properties #配置管理服务端口号,默认为8080 server.port=8080 #服务访问路径 server.servlet.context-path=/ # 输出的log文件名 logging.file.name=mc # 输出的文件的路径 logging.file.path=./logs/mc/ # 限制日志文件的大小 logging.file.max-size=10MB # 日志的保存天数 logging.file.max-history=7 # 输出级别 logging.level.root=warn logging.level.cn.com.hxyl.filebs=debug # xml配置文件 logging.config=classpath:logback-spring.xml #关闭缓存 spring.thymeleaf.cache=false spring.thymeleaf.prefix=classpath:/static/ server.tomcat.threads.max=100 server.tomcat.threads.min-spare=30 #开启项目热部署 spring.devtools.restart.enabled=true ``` ### 4.创建LoginController,实现必要的前端需要的接口 ![在这里插入图片描述](https://img-blog.csdnimg.cn/a63ea80e700846008750e8577e8cd280.png) ![在这里插入图片描述](https://img-blog.csdnimg.cn/8b73b5f6c560402791ac33d8f6c6b821.png) ![在这里插入图片描述](https://img-blog.csdnimg.cn/8da7dd6e919440a382a99e3a8575ebf6.png) ### 5.编译前端代码 ```bash yarn run build ``` ![编译前端代码](https://img-blog.csdnimg.cn/e3f53f3689044be6be3b077e58ed2a03.png) ### 6.将编译好的文件复制到SpringBoot工程中 将下图所示编译好的前端代码(左图所示dist\目录下的文件)复制到SpringBoot工程中 ![在这里插入图片描述](https://img-blog.csdnimg.cn/71498fc1bcff46c9993437927d266c01.png) ## 三、启动服务访问页面 ![在这里插入图片描述](https://img-blog.csdnimg.cn/9f90ba2d8b4e496a8e8e61dd0ac92d10.png) > 代码已上传至Gitee https://gitee.com/duyanjun/mcboot.git