解决: 若依 vue分离版 前后端 打包
前端 vite
后端springboot
前端有点恶心 和之前的目录结构不一样,让我出现了怀疑自己的幻觉
之前:
现在:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> <version>3.0.9</version> </dependency>
spring: thymeleaf: prefix: classpath:/static/ mode: HTML encoding: utf-8 cache: false
.antMatchers(HttpMethod.GET, "/index", "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**", "/**/assets/**", "/static/**", "/favicon.ico" )
这个文件:
package com.joint.framework.config; 包下的 ResourcesConfig文件
@Override public void addViewControllers(ViewControllerRegistry registry) { registry.addViewController("/index").setViewName("index.html"); registry.addViewController("/").setViewName("index.html"); registry.setOrder(Ordered.HIGHEST_PRECEDENCE);