feat: support send Email to others (close #44)

This commit is contained in:
JustSong
2023-04-16 11:23:05 +08:00
parent 3d38260e5b
commit c16530cf6e
5 changed files with 53 additions and 5 deletions
+7 -2
View File
@@ -631,6 +631,10 @@ func ManageUser(c *gin.Context) {
user.Role = common.RoleAdminUser
case "demote":
user.Role = common.RoleCommonUser
case "allow_send_email_to_others":
user.SendEmailToOthers = common.SendEmailToOthersAllowed
case "disallow_send_email_to_others":
user.SendEmailToOthers = common.SendEmailToOthersDisallowed
}
if err := user.Update(false); err != nil {
@@ -641,8 +645,9 @@ func ManageUser(c *gin.Context) {
return
}
clearUser := model.User{
Role: user.Role,
Status: user.Status,
Role: user.Role,
Status: user.Status,
SendEmailToOthers: user.SendEmailToOthers,
}
c.JSON(http.StatusOK, gin.H{
"success": true,