This commit is contained in:
+5
-2
@@ -7,6 +7,7 @@ import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
//"fmt"
|
||||
)
|
||||
|
||||
type DDY struct {
|
||||
@@ -17,7 +18,7 @@ type DDY struct {
|
||||
|
||||
func (this *DDY) Init(apikey string) {
|
||||
this.ApiKey = apikey
|
||||
this.YzmUrl = "https://api.dingdongcloud.com/v1/sms/captcha/send"
|
||||
this.YzmUrl = "https://api.dingdongcloud.com/v2/sms/single_send"
|
||||
this.TzUrl = "https://api.dingdongcloud.com/v1/sms/notice/multi_send"
|
||||
}
|
||||
|
||||
@@ -55,12 +56,14 @@ func (this *DDY) send(mUrl string, umoblie string, content string) (bool, error)
|
||||
return false, errors.New("连接错误")
|
||||
}
|
||||
|
||||
|
||||
|
||||
var msg interface{}
|
||||
err1 := json.Unmarshal([]byte(res), &msg)
|
||||
if err1 != nil {
|
||||
return false, errors.New("json解析错误")
|
||||
}
|
||||
|
||||
//fmt.Println(msg)
|
||||
resmsg := msg.(map[string]interface{})
|
||||
rcode := int(resmsg["code"].(float64))
|
||||
result := resmsg["msg"].(string)
|
||||
|
||||
Reference in New Issue
Block a user