如图,我用Springboot+thymeleaf 返回了页面,但访问静态资源有问题。类型也不对。我有整合了Shiro框架
shiro过滤部分:
资源目录:
页面引用css:
<link href="/dist/css/style.min.css" rel="stylesheet">
用这个标签时会报错:
<link th:href="@{/static/dist/css/style.min.css}" rel="stylesheet" type="text/css"/>
No mapping for GET /auth/static/dist/css/style.min.css
yml配置:
spring:
mvc:
static-path-pattern: /static/**
view:
prefix: /templates/
suffix: .html
resources:
static-locations: classpath:/static/
thymeleaf:
#缓冲的配置
cache: false
check-template: true
check-template-location: true
#开启MVC thymeleaf 视图解析
enabled: true
encoding: utf-8
mode: HTML
prefix: classpath:/templates/
suffix: .html