溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

短信服務(wù) Go語言開發(fā)

發(fā)布時(shí)間:2020-07-08 13:35:56 來源:網(wǎng)絡(luò) 閱讀:972 作者:二郎神六號(hào) 欄目:軟件技術(shù)

短信服務(wù) Go語言開發(fā) 

采用的是阿里云-云通信-短信服務(wù),原來的阿里大于品牌已經(jīng)升級(jí)為“阿里云 · 云通信”。


用途

用戶注冊(cè)、找回密碼、用戶身份驗(yàn)證、驗(yàn)證碼登錄等等


使用說明

將其中的accessKeyId、accessKeySecret、phoneNumbers、signName、templateCode、templateParam替換成你的就可以直接使用了


package main 


import (

"fmt"

"github.com/KenmyZhang/aliyun-communicate/app"

)

var (

gatewayUrl = "http://dysmsapi.aliyuncs.com/"

accessKeyId = "*******"

accessKeySecret = "*************"

phoneNumbers = "1354*********"

signName = "KenmyZhang"

templateCode = "SMS_82045083"

templateParam = "{\"code\":\"1234\"}"

)


func main() {

smsClient := app.NewSmsClient(gatewayUrl)

if result, err := smsClient.Execute(accessKeyId, accessKeySecret, phoneNumbers, signName, templateCode, templateParam); err != nil {

fmt.Println("error:%v", err.Error())

} else {

for key, value := range result {

fmt.Println("key:%v", key, " value:",value)

}

}

}

代碼已歸檔至:https://github.com/KenmyZhang/aliyun-communicate

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI