Home  >  Q&A  >  body text

java - 关于手机验证码的问题

1 . 框架 spring , jpa
2 . 我现在用有一个功能是app注册,我发送一个短信到手机 ,然后注册哪里进行比较验证,
假设发送手机验证码的方法是 getsms() ,比较的方法是 checksms() ,如果同时10个人注册,getsms()方法调用10次,发送10条验证码, 也就是我有10个验证 , 那么checksms()怎么知道那个验证码是谁的 ?

迷茫迷茫2766 days ago403

reply all(3)I'll reply

  • 怪我咯

    怪我咯2017-04-17 17:40:38

    After generating the verification code, save the mobile phone number and verification code at the same time, and then you can judge.

    reply
    0
  • 迷茫

    迷茫2017-04-17 17:40:38

    When sending, it is based on the mobile phone number. When verifying, you must also verify the current mobile phone number

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 17:40:38

    You can calculate a verification code based on your mobile phone number, so you don’t need to save it in the database.

    reply
    0
  • Cancelreply