html5 - 前端如何检测二维码已经被扫描?
巴扎黑
巴扎黑 2017-04-17 11:59:46
0
3
921

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

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

巴扎黑
巴扎黑

reply all(3)
阿神

I opened your webpage in the office.

大家讲道理

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

左手右手慢动作

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.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template