接口地址:https://api.dzzui.com/api/qqlogin
返回格式:JSON
请求方式:GET/PSOT

请求参数说明:

名称 必填 类型 说明
  callback string 登录成功后,回调地址!
  method string 参数为login为前往登录,参数为check为校验登录!

返回参数说明:

名称 类型 说明
  code string 返回的状态码
  msg string 返回错误提示信息!
  method string 返回登录方式
  openid string 回调登录加密后QQ号
  name string 回调登录的QQ昵称
  avatar string 回调登录的QQ头像
  md5 string 回调登录数据签名

返回示例:

直接post回调地址

错误码参照:

  错误码 说明
  2 回调地址不能为空
  3 登录校验失败!

PHP演示:

<?php
//这是callback 回调文件
$post = array(
    "md5"        =>    $_POST["md5"]
);
$rel = _curl("https://api.dzzui.com/api/qqlogin?method=check",$post);
$arr = json_decode($rel,true);
if ($arr["code"] == 1) {
    echo "登录校验成功!";
}else{
    echo "登录校验失败!";
}


function _curl($url,$post=0,$header=0,$cookie=0,$referer=0,$ua=0,$nobaody=0){
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,$url);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    $httpheader[] = "Accept:*/*";
    $httpheader[] = "Accept-Encoding:gzip,deflate,sdch";
    $httpheader[] = "Accept-Language:zh-CN,zh;q=0.8";
    $httpheader[] = "Connection:close";
    curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader);
    if($post){
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
    }
    if($header){
        curl_setopt($ch, CURLOPT_HEADER, TRUE);
    }
    if($cookie){
        curl_setopt($ch, CURLOPT_COOKIE, $cookie);
    }
    if($referer){
        curl_setopt($ch, CURLOPT_REFERER, $referer);
    }
    if($ua){
        curl_setopt($ch, CURLOPT_USERAGENT,$ua);
    }else{
        curl_setopt($ch, CURLOPT_USERAGENT,"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.167 Safari/537.36");
    }
    if($nobaody){
        curl_setopt($ch, CURLOPT_NOBODY,1);
    }
    curl_setopt($ch, CURLOPT_ENCODING, "gzip");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
    $ret = curl_exec($ch);
    curl_close($ch);
    return $ret;
}