springboot项目浏览器加载Resource interpreted as Stylesheet but transferred with MIME type text/html 报错

最近在做springboot项目时,将项目从windows迁移到linux系统中,出现js、css、image等静态文件。
Resource interpreted as Stylesheet but transferred with MIME type text/html的报错
把解决该问题的思路写下来。
项目运行时打开浏览器窗口访问login页面
springboot项目 加载静态文件 transferred with MIME type text/html
发现没有css样式,js报错超多,图片无法显示。

一开始思考是不是资源路径位置写错,导致样式加载出错,但经过修改路径位置发现并没有解决。

然后我就把引入的资源文件全都注释了,发现问题还是存在。

通过以上判断应该不是前台项目模板出现问题,然后我就开始思考会不会在后端出了问题。
后来查资料发现原因可能出在过滤器上,于是将静态文件目录加到拦截器的白名单中,解决问题!
springboot项目 加载静态文件 transferred with MIME type text/html

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2021-07-26
  • 2022-12-23
  • 2021-06-20
猜你喜欢
  • 2021-10-17
  • 2021-09-08
  • 2022-12-23
  • 2021-05-28
  • 2021-10-27
  • 2021-07-14
相关资源
相似解决方案