Commit 6ca09af97eec54f3fffd5bbe494bced96940e7bd
1 parent
3e350151
解决邮件发送用户编号为空问题
Showing
1 changed file
with
4 additions
and
1 deletions
yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/mail/MailTemplateController.java
| ... | ... | @@ -2,6 +2,8 @@ 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; | |
| 5 | 7 | import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.*; |
| 6 | 8 | import cn.iocoder.yudao.module.system.convert.mail.MailTemplateConvert; |
| 7 | 9 | import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; |
| ... | ... | @@ -81,7 +83,8 @@ public class MailTemplateController { |
| 81 | 83 | @Operation(summary = "发送短信") |
| 82 | 84 | @PreAuthorize("@ss.hasPermission('system:mail-template:send-mail')") |
| 83 | 85 | public CommonResult<Long> sendMail(@Valid @RequestBody MailTemplateSendReqVO sendReqVO) { |
| 84 | - return success(mailSendService.sendSingleMailToAdmin(sendReqVO.getMail(), null, | |
| 86 | + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); | |
| 87 | + return success(mailSendService.sendSingleMailToAdmin(sendReqVO.getMail(), loginUser != null ? loginUser.getId() : null, | |
| 85 | 88 | sendReqVO.getTemplateCode(), sendReqVO.getTemplateParams())); |
| 86 | 89 | } |
| 87 | 90 | ... | ... |