The App-side OAuth (login authentication) module encapsulates the mainstream three-party login SDKs on the market, and provides the JS API to call the login authentication function uniformly.

Project Type API
uni-app uni.preLogin(OBJECT)uni.login(OBJECT)uni.getUserInfo(OBJECT)uni.closeAuthView()uni.getCheckBoxState(OBJECT)uni.getUniverifyManager(OBJECT)
5+App/Wap2App plus.oauth.*

如果服务端使用uniCloud,官方提供了uni-id云端统一登录服务,把微信登录、短信验证码登录及角色权限管理等服务端登录开发,进行了统一的封装。前端统一的uni.login和云端统一的uni-id搭配,可以极大提升登录业务的开发效率,强烈推荐给开发者使用。

Tip: The parameter configuration of the three-party login module can only take effect after submitting the cloud package. Please use the [custom base] when running and debugging the real machine (http://ask.dcloud.net.cn/article/35115)

The basic process of using the login authentication function:

  • Apply to the third-party login platform for activation, some platforms (such as WeChat login) will obtain the appid after the application is successful
  • Configure the parameters of the application (such as appid, etc.) in HBuilderX, and submit the cloud package to generate custom base
  • Call the API in the App project to log in, and after success, obtain the authorization ID and submit it to the business server to complete the login operation

支持的三方登录平台:

On This Page