This commit is contained in:
yangduo 2024-08-12 16:58:45 +08:00
parent 198d167e11
commit 1e82e82da3

View File

@ -134,6 +134,18 @@ func (this *MailApi) AddMail(c *gin.Context) {
return return
} }
if !this.CheckAttachment(reqJson.Attachments, c) {
return
}
if data, err := json.Marshal(reqJson.Recipients); err != nil || len(data) > 0xFFFF {
c.JSON(http.StatusOK, gin.H{
"code": 2,
"message": "收件人过多",
})
return
}
var count int64 = 0 var count int64 = 0
if f5.GetApp().GetOrmDb(constant.MAIL_DB).Table("t_mail").Where("unikey = ?", reqJson.UniKey).Count(&count); count > 0 { if f5.GetApp().GetOrmDb(constant.MAIL_DB).Table("t_mail").Where("unikey = ?", reqJson.UniKey).Count(&count); count > 0 {
c.JSON(http.StatusOK, gin.H{ c.JSON(http.StatusOK, gin.H{
@ -143,10 +155,6 @@ func (this *MailApi) AddMail(c *gin.Context) {
return return
} }
if !this.CheckAttachment(reqJson.Attachments, c) {
return
}
s := c.MustGet("session").(common.Session) s := c.MustGet("session").(common.Session)
acc := s.GetAccountAddress() acc := s.GetAccountAddress()