Commit 6ca09af97eec54f3fffd5bbe494bced96940e7bd

Authored by shizhong
1 parent 3e350151

解决邮件发送用户编号为空问题

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,6 +2,8 @@ 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;
5 import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.*; 7 import cn.iocoder.yudao.module.system.controller.admin.mail.vo.template.*;
6 import cn.iocoder.yudao.module.system.convert.mail.MailTemplateConvert; 8 import cn.iocoder.yudao.module.system.convert.mail.MailTemplateConvert;
7 import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO; 9 import cn.iocoder.yudao.module.system.dal.dataobject.mail.MailTemplateDO;
@@ -81,7 +83,8 @@ public class MailTemplateController { @@ -81,7 +83,8 @@ public class MailTemplateController {
81 @Operation(summary = "发送短信") 83 @Operation(summary = "发送短信")
82 @PreAuthorize("@ss.hasPermission('system:mail-template:send-mail')") 84 @PreAuthorize("@ss.hasPermission('system:mail-template:send-mail')")
83 public CommonResult<Long> sendMail(@Valid @RequestBody MailTemplateSendReqVO sendReqVO) { 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 sendReqVO.getTemplateCode(), sendReqVO.getTemplateParams())); 88 sendReqVO.getTemplateCode(), sendReqVO.getTemplateParams()));
86 } 89 }
87 90