Files
juwan-backend/app/email/api/internal/logic/email/forgotPasswordLogic.go
T
zetaloop 62442a324a fix: 密码重置链路断裂与店铺模板类型不兼容
删除 users-api 的 forgot-password 空壳路由,email-api 的
forgotPasswordLogic 复用 sendVerificationCode 实现。shop 的
UpdateTemplateReq.Sections 从 interface{} 改为 string 以兼容
go-zero 反序列化。ResetPasswordReq.Phone 加 optional tag。
2026-04-05 17:59:56 +08:00

36 lines
854 B
Go

// Code scaffolded by goctl. Safe to edit.
// goctl 1.9.2
package email
import (
"context"
"juwan-backend/app/email/api/internal/svc"
"juwan-backend/app/email/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type ForgotPasswordLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
// 忘记密码-发送验证码
func NewForgotPasswordLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ForgotPasswordLogic {
return &ForgotPasswordLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *ForgotPasswordLogic) ForgotPassword(req *types.ForgotPasswordReq) (resp *types.SendVerificationCodeResp, err error) {
return NewSendVerificationCodeLogic(l.ctx, l.svcCtx).SendVerificationCode(&types.SendVerificationCodeReq{
Email: req.Email,
Scene: "reset_password",
})
}