Cloud.startLogin(options: Object)

支持端:Web 1.1.0

web 中发起网页授权登录

参数

options: Object

属性类型默认值必填说明
providerstring授权提供方,必填 OfficialAccount (公众号)
appidstring公众号 AppID
scopestring授权 scope,比如 snsapi_base、snsapi_userinfo
redirectUristring网页授权重定向 URL

使用说明

调用,会进行网页重定向,开始网页授权流程。

示例代码

  1. cloud.startLogin({
  2. provider: 'OfficialAccount',
  3. appid: '', // 公众号 AppID
  4. scope: 'snsapi_base', // snsapi_base 或 snsapi_userinfo
  5. redirectUri: ``, // 网页授权重定向 URL
  6. })