Home  >  Q&A  >  body text

html5 - 前端如何检测二维码已经被扫描?

杜蕾斯 遇见爱 双机微信互动

这个案例中用另一台手机扫描二维码之后,生成二维码的手机就会自动隐藏二维码,这个是通过什么识别的?

巴扎黑巴扎黑2742 days ago897

reply all(3)I'll reply

  • 阿神

    阿神2017-04-17 12:01:46

    I opened your webpage in the office.

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-17 12:01:46

    The computer displays the QR code and initiates an ajax request at the same time. The server suspends the request.
    After the mobile phone scans the code, it will also send a request to the server with parameters that can determine the user. The server will respond after receiving the request. The request that was just pending

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 12:01:46

    It should be that after receiving the scan, the URL corresponding to the QR code will send a notification to the mobile phone where the QR code is located.
    So this QR code should have a unique parameter corresponding to the only mobile phone that is displaying it.

    The specific implementation is the problem that occurs once a day.

    Ajax polling, websocket, etc. are all available

    You can find a lot of solutions by searching on this site.

    reply
    0
  • Cancelreply