登录接口

正常
累计调用
9
总请求次数
计费方式
免费
完全免费
输出格式
JSON
响应数据类型
调用权限
公开
无需认证或需API Key
免费调用会员免费公开调用输出格式: JSON
接口描述
wx - 微信开放平台(扫码登录),适用于PC端网站,用户通过微信扫码授权
wechat - 微信服务号(网页授权),仅在微信内置浏览器中有效,适用于公众号菜单、微信内分享链接等场景
请求信息
请求方法: GET
请求地址 (GET/POST)
https://api.starhot.cc/API/login/index.php
示例地址
https://api.starhot.cchttp://v.starhot.cc/connect.php?act=login&appid=您的APPID&appkey=您的APPKEY&type=qq&redirect_uri=https://您的网站/callback.php&state=随机字符串
请求参数
参数名类型必填说明
appid string 应用ID,在"我的应用"中获取,如:f99abb60a4f4439d
appkey string 应用密钥,在"我的应用"中获取,请妥善保管不要泄露
type string 登录平台类型,可选值:qq、wx(微信开放平台-扫码登录)、wechat(微信服务号-网页授权)、alipay、sina、baidu、github、gitee、google、dingtalk、feishu 等
redirect_uri string 授权成功后的回调地址,必须与应用配置的授权域名匹配,需进行URL编码。示例:https://example.com/callback.php
state string 自定义状态参数,用于防止CSRF攻击或传递业务数据,回调时会原样返回。建议传入随机字符串并在回调时验证
act string 接口动作,固定值 login
状态码说明
状态码说明
200请求成功,服务器已成功处理了请求。
403服务器拒绝请求,可能缺少认证凭据或权限不足。
404请求的资源未找到,请检查请求地址是否正确。
429请求过于频繁,已超出速率限制,请稍后再试。
500服务器内部错误,请稍后重试或联系管理员。
在线测试
此处将显示接口返回结果...
调用示例
<?php
$url = 'https://api.starhot.cc/API/login/index.php';
$params = ['appid' => 'YOUR_VALUE', 'appkey' => 'YOUR_VALUE', 'type' => 'YOUR_VALUE', 'redirect_uri' => 'YOUR_VALUE', 'state' => 'YOUR_VALUE', 'act' => 'YOUR_VALUE', ];
$url .= '?' . http_build_query($params);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
import requests
url = "https://api.starhot.cc/API/login/index.php"
params = {
    'appid': 'YOUR_VALUE',
    'appkey': 'YOUR_VALUE',
    'type': 'YOUR_VALUE',
    'redirect_uri': 'YOUR_VALUE',
    'state': 'YOUR_VALUE',
    'act': 'YOUR_VALUE',
}
response = requests.get(url, params=params)
print(response.text)
const url = new URL('https://api.starhot.cc/API/login/index.php');
const params = {
    'appid': 'YOUR_VALUE',
    'appkey': 'YOUR_VALUE',
    'type': 'YOUR_VALUE',
    'redirect_uri': 'YOUR_VALUE',
    'state': 'YOUR_VALUE',
    'act': 'YOUR_VALUE',
};
Object.keys(params).forEach(key => url.searchParams.append(key, params[key]));
fetch(url)
    .then(response => response.text())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
API 接口列表