From 6d9737a5d257ec925c03416e5465748404b7730d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A1=9C=E8=8F=AF?= Date: Fri, 25 Aug 2023 15:01:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E7=9F=AD=E4=BF=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/code.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/models/code.go b/models/code.go index 1f9467c..a047386 100644 --- a/models/code.go +++ b/models/code.go @@ -6,7 +6,7 @@ import ( "math/rand" "net/smtp" "time" - // 引入阿里云短信 + "github.com/aliyun/alibaba-cloud-sdk-go/services/dysmsapi" ) @@ -54,6 +54,10 @@ func CodeCreate(email, mobile string) (err error) { if mobile != "" { // 发送短信 client, err := dysmsapi.NewClientWithAccessKey("cn-hangzhou", "your-access-key-id", "your-access-key-secret") + if err != nil { + fmt.Println(err) + return err + } request := dysmsapi.CreateSendSmsRequest() request.Scheme = "https" request.PhoneNumbers = mobile