加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ajax.php 7.75 KB
一键复制 编辑 原始数据 按行查看 历史
凡之 提交于 2021-06-08 20:56 . first commit
<?php
/**
* ajax接收端
* 自定义接口会提交的数据为:
* value[0~6],代表输入框内容
*/
include("./includes/fun.global.php");
@header('Content-Type: application/json; charset=UTF-8');
switch ($_QET['act']) {
case 'SSID': //说说ID获取
test(['value0|e'], 'QQ号不能为空');
$Data = \Curl\Curl::curl(false, ['act' => 'ssid', 'qq' => $_QET['value0'], 'page' => 1], true, '/qtapi/index', 2);
if ($Data['code'] >= 0) {
if (count($Data['data']) == 0) dies(-1, '没有获取到任何说说,请先在空间内发布一条说说试试!');
$content = '';
foreach ($Data['data'] as $value) {
$content .= '<hr>说说ID:<font color="#66cdaa">' . $value['ssid'] . '</font><br>说说内容:' . $value['content'] . '<br>发布时间:' . $value['addtime'];
}
dier([
'code' => 1,
'msg' => '<div style="font-size: 0.7rem"><font>共获取到' . count($Data['data']) . '条说说,已经自动帮您填写好了第一条,可在下方列表长按复制其他的ID</font><br>' . $content . '</div>',
'data' => [$_QET['value0'], $Data['data'][0]['ssid']],
]);
} else dies(-1, 'QQ[' . $_QET['value0'] . ']的说说ID获取失败!');
break;
case 'DYID': //DYid
test(['value|e'], 'DY链接不可为空!');
$Url = URLExtraction($_QET['value']);
$Data = \Curl\Curl::curl(false, ['act' => 'getshareid', 'url' => $Url], true, '/qtapi/index', 2);
if ($Data['code'] >= 0) {
dier([
'code' => 1,
'msg' => '恭喜,ID获取成功',
'value' => $Data['songid'],
]);
} else dies(-1, 'DYID获取失败!');
break;
case 'HSID':
test(['value|e'], '火山链接不可为空!');
$Url = URLExtraction($_QET['value']);
$Data = GetHSID($Url);
if ($Data['code'] >= 0) {
dier([
'code' => 1,
'msg' => '恭喜,ID获取成功',
'value' => $Data['hsid'],
]);
} else dies(-1, '火山ID获取失败!');
break;
case 'WSID':
test(['value|e'], '微视链接不可为空!');
$Url = URLExtraction($_QET['value']);
$Data = GetWSID($Url);
if ($Data['code'] >= 0) {
dier([
'code' => 1,
'msg' => '恭喜,ID获取成功',
'value' => $Data['wsid'],
]);
} else dies(-1, '微视ID获取失败!');
break;
case 'JRTTID':
test(['value|e'], '今日头条链接不可为空!');
$Url = URLExtraction($_QET['value']);
$Data = GetJRTTID($Url);
if ($Data['code'] >= 0) {
dier([
'code' => 1,
'msg' => '恭喜,ID获取成功',
'value' => $Data['jrttid'],
]);
} else dies(-1, '今日头条ID获取失败!');
break;
case 'PPXID':
test(['value|e'], '链接不可为空!');
$Url = URLExtraction($_QET['value']);
$Data = PPXID($Url);
if ($Data['code'] >= 0) {
dier([
'code' => 1,
'msg' => '恭喜,ID获取成功',
'value' => $Data['ppxid'],
]);
} else dies(-1, 'ID获取失败!');
break;
case 'XHSID':
test(['value|e'], '链接不可为空!');
$Url = URLExtraction($_QET['value']);
$Data = XHSID($Url);
if ($Data['code'] >= 0) {
dier([
'code' => 1,
'msg' => '恭喜,ID获取成功',
'value' => $Data['xhsid'],
]);
} else dies(-1, 'ID获取失败!');
break;
case 'MPID':
test(['value|e'], '链接不可为空!');
$Url = URLExtraction($_QET['value']);
$Data = MPID($Url);
if ($Data['code'] >= 0) {
dier([
'code' => 1,
'msg' => '恭喜,ID获取成功',
'value' => $Data['mpid'],
]);
} else dies(-1, 'ID获取失败!');
break;
case 'BLIID':
test(['value|e'], '链接不可为空!');
$Url = URLExtraction($_QET['value']);
$Data = BLIID($Url);
if ($Data['code'] >= 0) {
dier([
'code' => 1,
'msg' => '恭喜,ID获取成功',
'value' => $Data['bliid'],
]);
} else dies(-1, 'ID获取失败!');
break;
case 'ZYOUID':
test(['value|e'], '链接不可为空!');
$Url = URLExtraction($_QET['value']);
if (!strstr($Url, 'izuiyou.com')) dies(-1, '分享链接有误!');
$ID = getSubstr($Url, '?pid=', '&amp;zy_to=');
if (!$ID) dies(-1, '分享链接有误!');
dier([
'code' => 1,
'msg' => '恭喜,ID获取成功',
'value' => $ID,
]);
break;
case 'QMKGID':
test(['value|e'], '链接不可为空!');
$Url = URLExtraction($_QET['value']);
if (strstr($Url, 'kg.qq.com')) {
$ID = getSubstr($Url, 'play?s=', '&amp;appsource=');
} else if (strstr($Url, 'kg2.qq.com')) {
$ID = getSubstr($Url, '/play?s=', '&amp;shareuid');
} else dies(-1, '分享链接有误!');
if (!$ID) dies(-1, '分享链接有误!');
dier([
'code' => 1,
'msg' => '恭喜,ID获取成功',
'value' => $ID,
]);
break;
case 'MTXXID':
test(['value|e'], '链接不可为空!');
$Url = URLExtraction($_QET['value']);
if (!strstr($Url, 'meitu.com')) dies(-1, '分享链接有误!');
$ID = getSubstr($Url, 'feed_id=', '&amp;lang=');
if (!$ID) dies(-1, '分享链接有误!');
dier([
'code' => 1,
'msg' => '恭喜,ID获取成功',
'value' => $ID,
]);
break;
case 'LVZID':
test(['value|e'], '链接不可为空!');
$Url = URLExtraction($_QET['value']);
if (!strstr($Url, 'oasis.weibo.cn')) dies(-1, '分享链接有误!');
$ID = getSubstr($Url, '?sid=', '');
if (!$ID) dies(-1, '分享链接有误!');
dier([
'code' => 1,
'msg' => '恭喜,ID获取成功',
'value' => $ID,
]);
break;
case 'OrderState': //查询支付状态,公共查询模块
$DB = \Medoo\DB\SQL::DB();
if (empty($_QET['order'])) dies(-1, '请将数据提交完整!');
$Pay = $DB->get('pay', '*', [
'order' => $_QET['order']
]);
if ($Pay['state'] == 1) {
if ($_QET['type'] == 2) {
dies(1, '支付订单已完成');
} else {
switch ($Pay['gid']) {
case -1: //在线充值
dies(1, '恭喜您成功充值' . round($Pay['money'], 2) . '元!');
break;
case -2: //订单队列
dies(1, '恭喜您成功购买' . $Pay['name'] . '!');
break;
default: //普通付款订单
dies(1, '恭喜您成功购买' . $Pay['name'] . '!');
break;
}
}
} else dies(-1, '支付订单未完成!');
break;
default:
header('HTTP/1.1 404 Not Found');
dies(-2, '访问路径不存在!');
break;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化