feature/v2.7.5 (#221)

* feature/v2.7.5 

1、非管理员修改昵称报错修复
2、IOS“邮件”客户端展示错误修复。
This commit is contained in:
Jinnrry authored and GitHub committed 2024-11-03 15:28:18 +08:00
1 parent 223117283b
commit 6697d2b229
3 files changed
+64 -7

No files matched your search

+7 -7
View File
@@ -65,21 +65,21 @@ func Send(ctx *context.Context, w http.ResponseWriter, req *http.Request) {
return
}
if !ctx.IsAdmin && reqData.From.Name != ctx.UserAccount {
response.NewErrorResponse(response.ParamsError, "params error", "").FPrint(w)
return
}
if reqData.From.Email != "" {
infos := strings.Split(reqData.From.Email, "@")
if len(infos) != 2 || !array.InArray(infos[1], config.Instance.Domains) {
response.NewErrorResponse(response.ParamsError, "params error", "").FPrint(w)
return
}
if !ctx.IsAdmin && infos[0] != ctx.UserAccount {
response.NewErrorResponse(response.ParamsError, "params error", "").FPrint(w)
return
}
}
if reqData.From.Email == "" && reqData.From.Name != "" {
reqData.From.Email = reqData.From.Name + "@" + config.Instance.Domain
if reqData.From.Email == "" {
reqData.From.Email = ctx.UserAccount + "@" + config.Instance.Domain
}
if reqData.From.Email == "" {