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