一前端操作
1、publicPath: './',
2、去掉history否則路由會有問題
3、去掉接口/api處理
二后端操作
1、放入resource
2、添加映射
@Override public void addResourceHandlers(ResourceHandlerRegistry registry) { // 將/venus/**訪問映射到classpath:/static/ registry.addResourceHandler("/venus/**").addResourceLocations("classpath:/static/"); }
3、過濾掉此內容的校驗避免401 .antMatchers("/venus/**").anonymous()
以上操作完成后啟動后端代碼
訪問localhost:8080/venus/index.html即可