Small program to send SMS verification code complete tool

The first to offer a small program to send text messages sdk platform support small front-end program to send, cloud function, Dailu cloud function, as well as 60-second countdown plugin.

Small micro-channel program (code) version, you have nothing to generate, store, check verification code, SDK will help you to achieve a.

Applet cloud micro-channel function version, this version is more secure, avoiding the others after obtaining the source code, SMS account is lost.

Detail View:  http://smsow.zhenzikj.com/doc/sdk.html

Official website:  http://smsow.zhenzikj.com

 

  1. How to send SMS

zhenzisms.client.sendCode( function (res){
                 console.log(res.data);
              }, number, '验证码为:{code}' , messageId, seconds, length);

Only needs to write the {code} placeholder, sdk codes generated automatically and replace

seconds: authentication code is valid, in seconds, for example 5 minutes

length: length codes, such as four or six

 

2. how to fill out a user check codes

 

var  result = zhenzisms.client.validateCode(number, code);

Parameters number: phone number to send text messages

Parameter code: this code entered by the user

The result is a string, ok: the verification is successful, empty: not generate verification codes, number_error: inconsistent phone number, code_error: verification code is inconsistent, code_expired: verification code has expired

Guess you like

Origin www.cnblogs.com/seeto/p/11221290.html