Joke Collection Website - Blessing messages - Can the front-end SMS verification code log in automatically?

Can the front-end SMS verification code log in automatically?

The front-end SMS verification code login can be automatically logged in. The method is as follows:

1, front-end login page, mobile phone number verification code login page. Button styles are all written by ourselves. Buttons are actually implemented with div+a class, adding dynamic styles.

2. The front-end can obtain the verification code. First, the mobile phone number is judged to be empty. If it is empty, the user is prompted that it cannot be empty, and then the mobile phone number is restricted by regular expression.

3. The backend obtains the verification code. Obtain relevant parameters from the platform and fill them in. Call the interface function of sending SMS verification code provided by their platform to see if it is sent successfully. If it is sent successfully, phoneNum-verifyCode will be saved in the redis database in the form of key-value pairs, valid for 5 minutes, and will automatically expire after 5 minutes, prompting users to fill in and log in within 5 minutes.

4. The front-end and back-end registration functions are realized. A few more blank conditions (such as name and password cannot be empty, whether the user exists, whether the mobile phone number is registered, and whether the user name is registered) are similar. Firstly, the verification code is obtained through the mobile phone, and the successfully sent verification code is stored in the redis database for 5 minutes. Then, the user fills in the verification code, and the front end sends a request to the back end. If it is correct, the backend returns that the registration is successful.