跳到主要内容

扫码登录实现流程

· 阅读需 2 分钟
Jack Ning
Maintainer of Bytedesk
  • 桌面客户端生成唯一设备uid:deviceUid
  • 将此deviceUid发送给服务端,服务端返回随机码:randomCode
  • 桌面客户端使用randomCode和deviceUid生成二维码
  • 手机端扫描此二维码,获取到deviceUid,将deviceUid发送给服务端,服务端更新状态为已扫描SCANED
  • 手机端点击确认登录,将手机号mobile和deviceUid发送给服务端,服务端保存手机号并更新状态为已登录CONFIRMED
  • 桌面客户端通过轮询获取到手机号mobile和状态为已登录CONFIRMED,利用手机号和随机码randomCode,调用登录接口
  • 如果桌面客户端拉取到的状态为EXPIRED,则需要重新拉取随机码randomCode,并重新生成二维码
  • 登录成功,返回accessToken,桌面客户端将此accessToken保存到本地,跳转到首页

Welcome

· 阅读需 1 分钟
Sébastien Lorber
Docusaurus maintainer
Yangshun Tay
Front End Engineer @ Facebook

Docusaurus blogging features are powered by the blog plugin.

Simply add Markdown files (or folders) to the blog directory.

Regular blog authors can be added to authors.yml.

The blog post date can be extracted from filenames, such as:

  • 2019-05-30-welcome.md
  • 2019-05-30-welcome/index.md

A blog post folder can be convenient to co-locate blog post images:

Docusaurus Plushie

The blog supports tags as well!

And if you don't want a blog: just delete this directory, and use blog: false in your Docusaurus config.

First Blog Post

· 阅读需 1 分钟
Gao Wei
Docusaurus Core Team

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque elementum dignissim ultricies. Fusce rhoncus ipsum tempor eros aliquam consequat. Lorem ipsum dolor sit amet