java - 用移动端扫描二维码并授权后,web端是如何实现自动登陆并跳转的?
伊谢尔伦
伊谢尔伦 2017-04-18 10:46:29
0
3
909
伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(3)
刘奇

Back-end redirection, some information of the QR code can be placed in the url parameters

Peter_Zhu

I’ve never done this, but I have an idea.
You can use websocket
to generate a QR code as a connection and cache the socket_id at the same time.
http://www.xxx.com/api/login/{socket_id}
When the QR code is scanned, send a request to login/{socket_id}
Use scoket_id in the backend and use websocket to notify the page to jump.
The specific login business can be written in login.
It doesn’t need to be a URL, as long as the socket_id can be transmitted to the server through the mobile terminal.

黄舟

ajax polling, this is what WeChat does.

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