Requirements are as follows
The customer registers an app, fills in the phone number, needs to receive the verification code, then registers.
Customer actions
Fill in your mobile phone number and click Get Verification code.
App Action
Incoming three parameters to the background: mobile phone number, their own randomly generated verification code (how many people decide), verify the content (MD5 (mobile phone number & Verification code)).
Background operation
1. Receive three parameters
2. Generate a CHECKSTR with mobile phone number & verification code.
Verify the Send code String CHECKSTR = message.getphonenumber () + "&" + Message.geticode ();
3. MD5 encryption for CHECKSTR, MySQL function is used here
SELECT MD5 (CONCAT (13258317626, ' & ', 123456))
4. Compare with the front desk MD5 encrypted string to prevent others from malicious cyclic registration
5. This part of the complete code is as follows
Verify the Send code String CHECKSTR = message.getphonenumber () + "&" + Message.geticode (); Call the database once for MD5 encryption String md5data = Smsinfomapper.getmd5data (CHECKSTR); Compared to the foreground MD5 encrypted string, the role is to prevent others from malicious cyclic registration if (!md5data.equals (Message.getsign ())) {Resultobject.setresu Ltmsg (resultmsg.msg_checkcode_failed); return resultobject; }
MYSQL--MD5 Encryption