diff --git a/src/main/java/net/mingsoft/config/WebConfig.java b/src/main/java/net/mingsoft/config/WebConfig.java index cc2dfbd8..36159cb7 100644 --- a/src/main/java/net/mingsoft/config/WebConfig.java +++ b/src/main/java/net/mingsoft/config/WebConfig.java @@ -94,7 +94,7 @@ public class WebConfig implements WebMvcConfigurer { registry.addResourceHandler(uploadMapping).addResourceLocations(File.separator+uploadFloderPath+File.separator,"file:"+uploadFloderPath+File.separator,"classpath:/template/"); registry.addResourceHandler("/template/**").addResourceLocations(File.separator+template+File.separator,"file:"+template+File.separator,"classpath:/html/"); //注意这里的htmlDir资源不能使用File.separator替代"/",会导致Windows一键版访问失效 - registry.addResourceHandler(htmlDir.concat("/**")).addResourceLocations(htmlDir.concat("/"),"file:".concat(htmlDir).concat("/")); + registry.addResourceHandler("/".concat(htmlDir).concat("/**")).addResourceLocations("/".concat(htmlDir).concat("/"),"file:".concat(htmlDir).concat("/")); //三种映射方式 webapp下、当前目录下、jar内 registry.addResourceHandler("/app/**").addResourceLocations("/app/","file:app/", "classpath:/app/"); registry.addResourceHandler("/static/**").addResourceLocations("/static/","file:static/","classpath:/static/","classpath:/META-INF/resources/"); diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 0b8e1680..5b117e16 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -13,7 +13,7 @@ logging: path: log #会在项目的根目录下生成log目录,里面会生成对应的日期目录,日期目录下面生成日志压缩包备份文件,默认按每10M分割一个日志文件,例如:log/2020-01/app-2020-01-03-18.1.log.gz(表示2020年1月3号下午六点的第一个备份),也可以根据实际情况写绝对路径,例如:d:/log ms: diy: - html-dir: /html + html-dir: html # scheme: https #解决使用代理服务器代理应用时标签解析域名依旧为http的问题 swagger: enable: false #启用swagger文档,生产的时候务必关掉 访问地址:http://ip|域名/项目发布名/swagger-ui.html