0.0.5 • Published 7 years ago
yuntongzhi-code v0.0.5
#云通知 NodeJS 客户端
##安装
npm i -S yuntongzhi-code
##使用
const YunTongZhi = require('yuntongzhi-code')
var sms = new YunTongZhi({user: 'username', passwd: 'password'})
//文本验证码
sms.text({mobile: 18800000000, content: '【云通知】模板测试,111111'}, function (err, result) {
if (err) return console.error(err.code, err.info) // 发送失败
console.info(result.code, result.info) //发送成功
})
//语音验证码
sms.voice({mobile: 18800000000, code: '123456'}, function (err, result) {
if (err) return console.error(err.code, err.info) // 发送失败
console.info(result.code, result.info) //发送成功
})
##API
YunTongZhi#text({mobile,content},callback(err,result))
YunTongZhi#voice({mobile,code},callback(err,result))