From ee16e8085f1fbbabd6350a12f22694ef195a3957 Mon Sep 17 00:00:00 2001 From: wujj <1027418825@qq.com> Date: Thu, 8 Apr 2021 17:35:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E8=AE=BF=E9=97=AE=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/net/mingsoft/config/WebConfig.java | 2 +- src/main/resources/application.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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