拿到新的前端包,
要進到spring boot使用Thymleaf引入, 遇到了問題
還有爆
Refused to apply style from 'OOXXX' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
查了一下得知, 原來是資源沒有引入的問題,
後來查了一下才知道
放在static下面的靜態資源要這樣引入
引入程式碼如下
<script th:src="@{plugin/jquery.i18n-1.0.7/jquery.i18n.emitter.min.js}"></script>
<script th:src="@{plugin/jquery.i18n-1.0.7/jquery.i18n.language.min.js}"></script>
<link rel="stylesheet" th:href="@{plugin/flatpickr-4.6.6/flatpickr.min.css}">
<link rel="stylesheet" th:href="@{plugin/flatpickr-4.6.6/themes/wistron.css}">
另外解決一直跳轉到login問題
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@Configuration
@EnableWebSecurity
public class SecurityConfigSEVEN extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
//super.configure(http);
//配置不需要登陆验证
http.authorizeRequests().anyRequest().permitAll().and().logout().permitAll();
}
}
參考網址:
https://blog.csdn.net/SEVENY_/article/details/104660418
參考網址:
https://blog.csdn.net/chenbetter1996/article/details/84994801
https://stackoverflow.com/questions/48248832/stylesheet-not-loaded-because-of-mime-type