1, constructs the mobile phone verification code: uses the Random object to generate the required stochastic number as the verification code, for example 4-bit verification code: 1000~9999 between the random number;
2, the use of the interface to the SMS platform to send mobile phone number and verification code data, and then the SMS platform to send verification code to the development of mobile phone number, interface parameters generally include: The target mobile phone number, random verification code (or contain failure time), platform interface address, platform password;
3, save the information returned by the interface (generally JSON text data, and then need to convert to JSON object format);
4, the mobile phone number-verification code, operation time into the session, as the latter to verify the use;
5, receive the user to fill in the verification code and other data;
6, compare the verification code submitted with the session of the verification code is consistent, and determine whether the submission action is within the validity period;
7, the verification code is correct and within the validity period, the request passes, handles the corresponding business.