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,7 +29,7 @@ public class YudaoCaptchaConfiguration { | ||
| 29 | // 缓存类型 redis/local/.... | 29 | // 缓存类型 redis/local/.... |
| 30 | CaptchaCacheService ret = CaptchaServiceFactory.getCache(config.getCacheType().name()); | 30 | CaptchaCacheService ret = CaptchaServiceFactory.getCache(config.getCacheType().name()); |
| 31 | if (ret instanceof RedisCaptchaServiceImpl) { | 31 | if (ret instanceof RedisCaptchaServiceImpl) { |
| 32 | - ((RedisCaptchaServiceImpl)ret).setStringRedisTemplate(stringRedisTemplate); | 32 | + ((RedisCaptchaServiceImpl) ret).setStringRedisTemplate(stringRedisTemplate); |
| 33 | } | 33 | } |
| 34 | return ret; | 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,8 +2,6 @@ package cn.iocoder.yudao.module.system.controller.admin.mail; | ||
| 2 | 2 | ||
| 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; | 3 | import cn.iocoder.yudao.framework.common.pojo.CommonResult; |
| 4 | import cn.iocoder.yudao.framework.common.pojo.PageResult; | 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 | import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.*; | 5 | import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.*; |
| 8 | import cn.iocoder.yudao.module.system.convert.mail.MailTemplateConvert; | 6 | import cn.iocoder.yudao.module.system.convert.mail.MailTemplateConvert; |
| 9 | import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; | 7 | import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; |
| @@ -20,6 +18,7 @@ import javax.validation.Valid; | @@ -20,6 +18,7 @@ import javax.validation.Valid; | ||
| 20 | import java.util.List; | 18 | import java.util.List; |
| 21 | 19 | ||
| 22 | import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; | 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 | @Tag(name = "管理后台 - 邮件模版") | 23 | @Tag(name = "管理后台 - 邮件模版") |
| 25 | @RestController | 24 | @RestController |
| @@ -83,8 +82,7 @@ public class MailTemplateController { | @@ -83,8 +82,7 @@ public class MailTemplateController { | ||
| 83 | @Operation(summary = "发送短信") | 82 | @Operation(summary = "发送短信") |
| 84 | @PreAuthorize("@ss.hasPermission('system:mail-template:send-mail')") | 83 | @PreAuthorize("@ss.hasPermission('system:mail-template:send-mail')") |
| 85 | public CommonResult<Long> sendMail(@Valid @RequestBody MailTemplateSendReqVO sendReqVO) { | 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 | sendReqVO.getTemplateCode(), sendReqVO.getTemplateParams())); | 86 | sendReqVO.getTemplateCode(), sendReqVO.getTemplateParams())); |
| 89 | } | 87 | } |
| 90 | 88 |