Problem: WebApp Phone Verification Code login often appear captcha error login failed.
Analysis Reason: The authentication method of the login is written on the service side through the general processing program, each time through the Ajax access to the general processing program to return the success or failure, finally, the foreground input mobile phone number and verification code has passed to the general processing program to compare. Frequent verification code error, login failed, but see the text message is sent by the verification code yes. And the service side of the verification code in the session, and found a long time to find the problem. is because if the first time to send a verification code success but did not go to verify, the second person has applied for a verification, resulting in the first verification code is overwritten by the second verification Code, so the first person to verify that can not be verified success.
Solution idea: Put the verification method in the client's JS to verify. Each time the AJAX request to send a verification code of the general handler, send a successful, send the verification code as the return value, in the JS to receive the return value, and finally at each landing time to determine the user input verification code and Ajax return is consistent, if consistent call the login service. This avoids the previous method of verifying code errors that have been reported.
How to avoid comparing verification code errors on the server when logging in