From 4d097df620483b05ebf3bca912311a66d42d6565 Mon Sep 17 00:00:00 2001 From: xuthus Date: Thu, 23 Dec 2021 11:17:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wx_post/config/OhMyEmailConfig.java | 2 +- .../wx_post/config/ResourcesConfig.java | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 src/main/java/cn/xuthus83/wx_post/config/ResourcesConfig.java diff --git a/src/main/java/cn/xuthus83/wx_post/config/OhMyEmailConfig.java b/src/main/java/cn/xuthus83/wx_post/config/OhMyEmailConfig.java index a9adf48..e99197d 100644 --- a/src/main/java/cn/xuthus83/wx_post/config/OhMyEmailConfig.java +++ b/src/main/java/cn/xuthus83/wx_post/config/OhMyEmailConfig.java @@ -17,6 +17,6 @@ public class OhMyEmailConfig { public void before() { // 配置,一次即可 - OhMyEmail.config(OhMyEmail.SMTP_QQ(false), "913651466@qq.com", "xgz187415157"); + OhMyEmail.config(OhMyEmail.SMTP_QQ(false), "913651466@qq.com", ""); } } diff --git a/src/main/java/cn/xuthus83/wx_post/config/ResourcesConfig.java b/src/main/java/cn/xuthus83/wx_post/config/ResourcesConfig.java new file mode 100644 index 0000000..df9a394 --- /dev/null +++ b/src/main/java/cn/xuthus83/wx_post/config/ResourcesConfig.java @@ -0,0 +1,20 @@ +package cn.xuthus83.wx_post.config; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +/** + * 通用配置 + * + * @author ruoyi + */ +@Configuration +public class ResourcesConfig implements WebMvcConfigurer { + + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + /** 本地文件上传路径 */ + registry.addResourceHandler("profile/**").addResourceLocations("file:/mnts/"); + } +} \ No newline at end of file