feat-IRONFANS-187-Robin #686
|
@ -337,10 +337,10 @@ func WithdrawSendVerifycode(ctx *gin.Context) {
|
||||||
ReplyErrorMsg(ctx, "当前提现功能已冻结")
|
ReplyErrorMsg(ctx, "当前提现功能已冻结")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ec := service.DefaultService.WithdrawSendVerifycode(ctx, req)
|
ec, err := service.DefaultService.WithdrawSendVerifycode(ctx, req)
|
||||||
if ec != errcode.ErrCodeVasSrvOk {
|
if ec != errcode.ErrCodeVasSrvOk {
|
||||||
logger.Error("WithdrawSendVerifycode fail, req: %v, ec: %v", util.ToJson(req), ec)
|
logger.Error("WithdrawSendVerifycode fail, req: %v, ec: %v", util.ToJson(req), ec)
|
||||||
ReplyErrCodeMsg(ctx, ec)
|
ReplyErrCodeMsgAndDetail(ctx, errcode.ErrCodeLoginVeriCodeSendFail, err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ReplyOk(ctx, nil)
|
ReplyOk(ctx, nil)
|
||||||
|
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"math/rand"
|
"math/rand"
|
||||||
vericodeproto "service/api/proto/vericode/proto"
|
vericodeproto "service/api/proto/vericode/proto"
|
||||||
"service/app/mix/dao"
|
"service/app/mix/dao"
|
||||||
|
"service/bizcommon/util"
|
||||||
"service/dbstruct"
|
"service/dbstruct"
|
||||||
"service/library/configcenter"
|
"service/library/configcenter"
|
||||||
"service/library/idgenerator"
|
"service/library/idgenerator"
|
||||||
|
@ -96,11 +97,16 @@ func (p *VeriCode) OpSendVeriCode(ctx *gin.Context, req *vericodeproto.OpSendReq
|
||||||
TemplateCode: goproto.String(p.cfg.TemplateCode),
|
TemplateCode: goproto.String(p.cfg.TemplateCode),
|
||||||
TemplateParam: goproto.String(templateParam),
|
TemplateParam: goproto.String(templateParam),
|
||||||
}
|
}
|
||||||
err := sms.SendSms(request)
|
resp, err := sms.SendSms(request)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("SendSms failed : %v", err)
|
logger.Error("SendSms failed : %v", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if util.DerefString(resp.Body.Code) != "OK" {
|
||||||
|
msg := util.DerefString(resp.Body.Message)
|
||||||
|
logger.Error("SendSms failed : %v", msg)
|
||||||
|
return fmt.Errorf("%v", msg)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -581,7 +581,7 @@ func (s *Service) WithdrawPage(ctx *gin.Context, req *vasproto.WithdrawPageReq)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 提现发送验证码
|
// 提现发送验证码
|
||||||
func (s *Service) WithdrawSendVerifycode(ctx *gin.Context, req *vasproto.WithdrawSendVerifycodeReq) (ec errcode.ErrCode) {
|
func (s *Service) WithdrawSendVerifycode(ctx *gin.Context, req *vasproto.WithdrawSendVerifycodeReq) (ec errcode.ErrCode, err error) {
|
||||||
// 获取电话号
|
// 获取电话号
|
||||||
acntMap, _ := _DefaultAccount.GetAccountMapByMids(ctx, []int64{req.Mid})
|
acntMap, _ := _DefaultAccount.GetAccountMapByMids(ctx, []int64{req.Mid})
|
||||||
acnt, has := acntMap[req.Mid]
|
acnt, has := acntMap[req.Mid]
|
||||||
|
@ -595,7 +595,7 @@ func (s *Service) WithdrawSendVerifycode(ctx *gin.Context, req *vasproto.Withdra
|
||||||
phoneBs, _ := mycrypto.CryptoServiceInstance().AES.Decrypt(bytes)
|
phoneBs, _ := mycrypto.CryptoServiceInstance().AES.Decrypt(bytes)
|
||||||
logger.Info("WithdrawSendVerifycode, mid: %v, phone: %v", req.Mid, string(phoneBs))
|
logger.Info("WithdrawSendVerifycode, mid: %v, phone: %v", req.Mid, string(phoneBs))
|
||||||
|
|
||||||
err := _DefaultVeriCode.OpSendVeriCode(ctx, &vericodeproto.OpSendReq{
|
err = _DefaultVeriCode.OpSendVeriCode(ctx, &vericodeproto.OpSendReq{
|
||||||
BaseRequest: req.BaseRequest,
|
BaseRequest: req.BaseRequest,
|
||||||
MobilePhone: string(phoneBs),
|
MobilePhone: string(phoneBs),
|
||||||
RegionCode: util.DerefString(acnt.RegionCode),
|
RegionCode: util.DerefString(acnt.RegionCode),
|
||||||
|
|
|
@ -31,8 +31,8 @@ func Init(cfg *configcenter.DysmsapiConfig) (err error) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func SendSms(request *dysmsapi.SendSmsRequest) (err error) {
|
func SendSms(request *dysmsapi.SendSmsRequest) (_result *dysmsapi.SendSmsResponse, err error) {
|
||||||
_result, err := defaultDysmsapiClient.SendSms(request)
|
_result, err = defaultDysmsapiClient.SendSms(request)
|
||||||
logger.Info("SendSms result:%v", _result)
|
logger.Info("SendSms result:%v", _result)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("SendSms failed : %v", err)
|
logger.Error("SendSms failed : %v", err)
|
||||||
|
|
Loading…
Reference in New Issue