从前端下手,我用的是vue-element-admin框架
npm run build:prod
随后会打包出dist文件,把这文件复制粘贴到tomcat的webapps路径下面
![在这里插入图片描述](https://img-blog.csdnimg.cn/760847c109fe45fba5198434e0da0808.png)
启动tomcat后访问dist路径 localhost:8080/dist/ ,如果页面出现空白,可以把vue.config.js配置文件里的publicPath值改一下,斜杠前面加个 “.” 。
![在这里插入图片描述](https://img-blog.csdnimg.cn/1e759a1ee00c4769b7ab7f6070c4affd.png)
接下来打包后端,先加载一些依赖
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent<