add
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
||||
|
||||
"tyass-server/app/main/api/internal/svc"
|
||||
"tyass-server/app/main/api/internal/types"
|
||||
"tyass-server/pkg/captcha"
|
||||
|
||||
openapi "github.com/alibabacloud-go/darabonba-openapi/v2/client"
|
||||
dysmsapi "github.com/alibabacloud-go/dysmsapi-20170525/v3/client"
|
||||
@@ -35,6 +36,17 @@ func NewSendSmsLogic(ctx context.Context, svcCtx *svc.ServiceContext) *SendSmsLo
|
||||
}
|
||||
|
||||
func (l *SendSmsLogic) SendSms(req *types.SendSmsReq) error {
|
||||
// 图形验证码校验
|
||||
captchaCfg := l.svcCtx.Config.Captcha
|
||||
if err := captcha.Verify(captcha.Config{
|
||||
AccessKeyID: captchaCfg.AccessKeyID,
|
||||
AccessKeySecret: captchaCfg.AccessKeySecret,
|
||||
EndpointURL: captchaCfg.EndpointURL,
|
||||
SceneID: captchaCfg.SceneID,
|
||||
}, req.CaptchaVerifyParam); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
secretKey := l.svcCtx.Config.Encrypt.SecretKey
|
||||
encryptedMobile, err := crypto.EncryptMobile(req.Mobile, secretKey)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user