API 调用地址
{域名地址}/api/google/url
说明:{域名地址} 需要替换成你的域名地址,如 https://www.anqicms.com/api/google/url
完整的使用方法,参阅安企CMS谷歌登录配置教程
调用方法
GET
请求参数
| 字段名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| state | string | 否 | 登录跳转地址的 state 参数,不填就会自动生成 |
返回参数
| 字段名 | 类型 | 说明 |
|---|---|---|
| code | int | 错误码 |
| msg | string | 错误原因说明 |
| data | object | captcha 内容 |
data 参数
| 字段名 | 类型 | 说明 |
|---|---|---|
| state | string | 登录跳转地址的 state 值 |
| url | string | 跳转地址 |
请求数据示例
返回数据示例
{
"code": 0,
"data": {
"state": "state-value",
"url": "https://wwww.google.com/accounts/o/oauth2/auth?response_type=code&client_id=client-id&redirect_uri=https://www.anqicms.com/api/google/callback&scope=scope&state=state-value"
},
"msg": ""
}
错误代码
| 错误码 | 说明 |
|---|---|
| 0 | OK |
| -1 | 错误,错误原因在 msg 中指出 |
| 1001 | 未登录 |
| 1002 | 未授权 |
| 200 | API 请求 OK |