This commit is contained in:
2026-01-27 03:13:15 -08:00
parent 5def1cf6d8
commit 48c92ea374
36 changed files with 1189 additions and 123 deletions
@@ -5,6 +5,7 @@ import (
"encoding/json"
"fmt"
"net/http"
"strings"
"time"
"github.com/gin-gonic/gin"
@@ -31,6 +32,9 @@ func DeleteAccountHandler(serverCtx *svc.ServiceContext) gin.HandlerFunc {
return
}
// 统一处理邮箱格式:转小写并去空格,与发送验证码逻辑保持一致
req.Email = strings.ToLower(strings.TrimSpace(req.Email))
// 校验邮箱验证码
if err := verifyEmailCode(c.Request.Context(), serverCtx, req.Email, req.Code); err != nil {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})