Commit 16dd86a8db0f44a149b8b36b2784d1b28fcd3463
1 parent
933bb188
498 解决解决 Set access token expire time to 0 报错问题和邮件发送用户编号为空问题
Showing
2 changed files
with
3 additions
and
5 deletions
yudao-framework/yudao-spring-boot-starter-captcha/src/main/java/cn/iocoder/yudao/framework/captcha/config/YudaoCaptchaConfiguration.java
| ... | ... | @@ -29,7 +29,7 @@ public class YudaoCaptchaConfiguration { |
| 29 | 29 | // 缓存类型 redis/local/.... |
| 30 | 30 | CaptchaCacheService ret = CaptchaServiceFactory.getCache(config.getCacheType().name()); |
| 31 | 31 | if (ret instanceof RedisCaptchaServiceImpl) { |
| 32 | - ((RedisCaptchaServiceImpl)ret).setStringRedisTemplate(stringRedisTemplate); | |
| 32 | + ((RedisCaptchaServiceImpl) ret).setStringRedisTemplate(stringRedisTemplate); | |
| 33 | 33 | } |
| 34 | 34 | return ret; |
| 35 | 35 | } | ... | ... |
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailTemplateController.java
| ... | ... | @@ -2,8 +2,6 @@ package cn.iocoder.yudao.module.system.controller.admin.mail; |
| 2 | 2 | |
| 3 | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; |
| 5 | -import cn.iocoder.yudao.framework.security.core.LoginUser; | |
| 6 | -import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; | |
| 7 | 5 | import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.*; |
| 8 | 6 | import cn.iocoder.yudao.module.system.convert.mail.MailTemplateConvert; |
| 9 | 7 | import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; |
| ... | ... | @@ -20,6 +18,7 @@ import javax.validation.Valid; |
| 20 | 18 | import java.util.List; |
| 21 | 19 | |
| 22 | 20 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; |
| 21 | +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; | |
| 23 | 22 | |
| 24 | 23 | @Tag(name = "管理后台 - 邮件模版") |
| 25 | 24 | @RestController |
| ... | ... | @@ -83,8 +82,7 @@ public class MailTemplateController { |
| 83 | 82 | @Operation(summary = "发送短信") |
| 84 | 83 | @PreAuthorize("@ss.hasPermission('system:mail-template:send-mail')") |
| 85 | 84 | public CommonResult<Long> sendMail(@Valid @RequestBody MailTemplateSendReqVO sendReqVO) { |
| 86 | - LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); | |
| 87 | - return success(mailSendService.sendSingleMailToAdmin(sendReqVO.getMail(), loginUser != null ? loginUser.getId() : null, | |
| 85 | + return success(mailSendService.sendSingleMailToAdmin(sendReqVO.getMail(), getLoginUserId(), | |
| 88 | 86 | sendReqVO.getTemplateCode(), sendReqVO.getTemplateParams())); |
| 89 | 87 | } |
| 90 | 88 | ... | ... |