f
This commit is contained in:
@@ -37,17 +37,16 @@ func NewSendSmsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SendSmsLo
|
||||
|
||||
func (l *SendSmsLogic) SendSms(req *types.SendSmsReq) error {
|
||||
cfg := l.svcCtx.Config.Captcha
|
||||
// captcha 开关:关闭后直接跳过图形验证码校验
|
||||
if !cfg.Enable {
|
||||
return nil
|
||||
}
|
||||
if err := captcha.VerifyWithRequest(captcha.Config{
|
||||
AccessKeyID: cfg.AccessKeyID,
|
||||
AccessKeySecret: cfg.AccessKeySecret,
|
||||
EndpointURL: cfg.EndpointURL,
|
||||
SceneID: cfg.SceneID,
|
||||
}, req.CaptchaVerifyParam, l.ctx); err != nil {
|
||||
return err
|
||||
// captcha 开关:仅控制是否做图形校验;关闭时不校验,短信照常发送
|
||||
if cfg.Enable {
|
||||
if err := captcha.VerifyWithRequest(captcha.Config{
|
||||
AccessKeyID: cfg.AccessKeyID,
|
||||
AccessKeySecret: cfg.AccessKeySecret,
|
||||
EndpointURL: cfg.EndpointURL,
|
||||
SceneID: cfg.SceneID,
|
||||
}, req.CaptchaVerifyParam, l.ctx); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
// 默认action类型:当未传入时,默认为login,便于小程序环境兼容
|
||||
action := req.ActionType
|
||||
|
||||
Reference in New Issue
Block a user