我的个人网站:
http://riun.xyz


1、修改vuejs的config/index.js,在里面找到assetsPublicPath,改为/dist/,记住,是build:{}这里的,不是上面dev:{}的。

2、执行npm run build,会出现一个dist文件夹在vuejs项目目录里。

3、把这个dist文件夹copy到springboot的resources/static/,是整个dist连文件夹一起copy过来。如下图
在这里插入图片描述

4、SpringBoot项目只需要parent依赖和web依赖即可。

		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-web</artifactId>
		</dependency>

5、启动,访问:http://localhost:8080/dist/index.html

在这里插入图片描述

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐