Pārlūkot izejas kodu

mob验证码

master
huangjiajun pirms 5 dienas
vecāks
revīzija
c647f6414c
1 mainītis faili ar 8 papildinājumiem un 2 dzēšanām
  1. +8
    -2
      aliyun/sms.go

+ 8
- 2
aliyun/sms.go Parādīt failu

@@ -1,6 +1,7 @@
package aliyun

import (
utils "code.fnuoos.com/EggPlanet/egg_system_rules.git/utils"
"encoding/json"
"errors"
"fmt"
@@ -41,11 +42,16 @@ func AliyunSendSms(accessKeyId, accessKeySecret, phone, signName, templateCode,
}
}()
// 复制代码运行请自行打印 API 的返回值
_, _err = client.SendSmsVerifyCodeWithOptions(sendSmsVerifyCodeRequest, runtime)
body, _err := client.SendSmsVerifyCodeWithOptions(sendSmsVerifyCodeRequest, runtime)
if _err != nil {
return _err
}

if body != nil && body.Body != nil && body.Body.Code != nil && *body.Body.Code != "OK" {
if body.Body.Message != nil {
fmt.Println("阿里短信:" + utils.SerializeStr(body))
}
return errors.New("发送失败")
}
return nil
}()



Notiek ielāde…
Atcelt
Saglabāt