|
|
@@ -6,7 +6,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
-import top.husj.husj_wx.properties.MailProperties;
|
|
|
+import top.husj.husj_wx.properties.EmailProperties;
|
|
|
import top.husj.husj_wx.properties.WeChatProperties;
|
|
|
import top.husj.husj_wx.utils.AccessTokenUtil;
|
|
|
import top.husj.husj_wx.utils.EmailUtil;
|
|
|
@@ -19,7 +19,7 @@ public class AccessTokenService {
|
|
|
@Autowired
|
|
|
private WeChatProperties weChatProperties;
|
|
|
@Autowired
|
|
|
- private MailProperties mailProperties;
|
|
|
+ private EmailProperties emailProperties;
|
|
|
|
|
|
/**
|
|
|
* 刷新access_token的核心逻辑
|
|
|
@@ -47,12 +47,12 @@ public class AccessTokenService {
|
|
|
} catch (Exception e) {
|
|
|
log.error("获取access_token时发生异常: ", e);
|
|
|
EmailUtil emailUtil = new EmailUtil(
|
|
|
- mailProperties.getHost(),
|
|
|
- mailProperties.getPort(),
|
|
|
- mailProperties.getUsername(),
|
|
|
- mailProperties.getPassword()
|
|
|
+ emailProperties.getHost(),
|
|
|
+ emailProperties.getPort(),
|
|
|
+ emailProperties.getUsername(),
|
|
|
+ emailProperties.getPassword()
|
|
|
);
|
|
|
- emailUtil.sendTextEmail(mailProperties.getAlertTo(), "微信公众号token获取失败请检查", "微信公众号token获取失败请检查");
|
|
|
+ emailUtil.sendTextEmail(emailProperties.getNotifyTo(), "微信公众号token获取失败请检查", "微信公众号token获取失败请检查");
|
|
|
}
|
|
|
}
|
|
|
|