如果用户使用前后端分离的方式启动工程,不需要阅读此文章。如果用户使用前后端集成的方式启动工程,请务必仔细阅读下面内容。
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文件中添加依赖
<dependency>
<groupId>com.ustcinfo.ishare.eip</groupId>
<artifactId>eip-admin-starter-views</artifactId>
<version>{最新版本}</version>
</dependency>
修改配置文件
在 eip-admin-starter-rest 工程的配置文件中,增加如下配置,如果有不需要再添加
admin:
thymeleaf:
cache: false
encoding: utf-8
mode: LEGACYHTML5
prefix: classpath:/templates/
servlet:
content-type: text/html
suffix: .html
views:
# 后端地址访问前缀
baseUrl: http://localhost:${server.port}${server.servlet.context-path}
# 是否使用验证码,false为不使用,其他为使用
captchaEnable: true
# 布局设置,left-right为左右布局,up-down为上下布局
layout: left-right
#版权信息
copyright:
desc: 版权所有 © 2020~2023 技术中台PBU
company: 科大国创云网科技有限公司
link: http://www.gccloud.com/
启动项目
同单独启动后端工程方式,启动完成后默认访问地址为:http://localhost:8081/eip-admin-rest/