如果用户使用前后端分离的方式启动工程,不需要阅读此文章。如果用户使用前后端集成的方式启动工程,请务必仔细阅读下面内容。

eip-admin-starter-rest + eip-admin-starter-views 集成启动

因为前端工程为springboot项目,也可以通过jar包方式在 eip-admin-starter-rest 中引入 eip-admin-starter-views 工程,通过启动 eip-admin-starter-rest 工程同时启动前后端工程

Views工程打包

打开eip-admin-starter-views 工程,使用mvn install指令打包

引入Views工程

eip-admin-starter-rest 中引入 eip-admin-starter-views 工程,在 eip-admin-starter-rest 的pom文件中添加依赖

  1. <dependency>
  2. <groupId>com.ustcinfo.ishare.eip</groupId>
  3. <artifactId>eip-admin-starter-views</artifactId>
  4. <version>{最新版本}</version>
  5. </dependency>

修改配置文件

eip-admin-starter-rest 工程的配置文件中,增加如下配置,如果有不需要再添加

  1. admin:
  2. thymeleaf:
  3. cache: false
  4. encoding: utf-8
  5. mode: LEGACYHTML5
  6. prefix: classpath:/templates/
  7. servlet:
  8. content-type: text/html
  9. suffix: .html
  10. views:
  11. # 后端地址访问前缀
  12. baseUrl: http://localhost:${server.port}${server.servlet.context-path}
  13. # 是否使用验证码,false为不使用,其他为使用
  14. captchaEnable: true
  15. # 布局设置,left-right为左右布局,up-down为上下布局
  16. layout: left-right
  17. #版权信息
  18. copyright:
  19. desc: 版权所有 © 2020~2023 技术中台PBU
  20. company: 科大国创云网科技有限公司
  21. link: http://www.gccloud.com/

启动项目

同单独启动后端工程方式,启动完成后默认访问地址为:http://localhost:8081/eip-admin-rest/
合并启动成功.png