PHP in the YII2 framework, how to provide iOS SMS verification registration and mobile phone text back password interface?

Source: Internet
Author: User
Now need to provide an interface to iOS, one is mobile phone SMS authentication registration, one is the mobile phone text back password. Do not know how to deal with, can someone guide you? Thank you very much, I was doing the project under the YII2 framework.

Reply content:

Now need to provide an interface to iOS, one is mobile phone SMS authentication registration, one is the mobile phone text back password. Do not know how to deal with, can someone guide you? Thank you very much, I was doing the project under the YII2 framework.

Does this have anything to do with the framework?

    • SMS Verification Registration: RAND (0,999999) generates a random, call the third-party SMS send interface to send the verification code, send successfully into the DB, register the time to verify the size of this

    • Recover Password: Ditto, retrieve password is actually password reset?

Send SMS Interface

public function actionSendsms($phone){    1.验证手机号码是否合法    2.缓存检测短信发送频率(1分钟一条)    3.生成验证码,写入缓存(缓存1,有效期3分钟)    4.设置缓存,有效期1分钟(与第2条对应)    5.返回发送成功的JSON}public function actionCheckcode($phone,$code){    1.读取第3步的缓存,如果不存在,报错“验证码过期”    2.如果验证码错误,报错“验证码错误”    3.通过验证}

Main, actually you say these two functions and PC side difference is very small very small, the difference is in the return data. PC-side you should have done it! It is the user who submits to the form that you are using PHP to receive the corresponding parameters, and then logic processing, on the page to give the user prompt. The interface is to return the data you processed to the client, no matter what the framework is the same, just provide a link to the client, this link is your interface

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.