Files
Fuxsto-V4/Main/Login/CallBack.php
2025-10-18 10:19:37 +08:00

32 lines
1.1 KiB
PHP

<?php
include_once "../Hv4.Function.php";
// 设置目标 URL
$链接 = "https://auth.fuxsto.cn/Main/LoginApp/?act=CallBack&task=".$_GET["task"];
$数据 = JSON解析(file_get_contents($链接));
if ($数据["code"] == 200) {
$数据 = $数据["msg"];
$QQ = $数据["qq"];
$密码 = @唯一字符串();
$用户名 = $数据["username"];
$语句 = "SELECT `id`, `username`, `qq`, `score`, `balance`, `status`
FROM `users`
WHERE `username` = '$用户名';";
$结果 = reset(数据库运行($语句));
if (!$结果) {
$语句 = "INSERT INTO `users` (`username`, `password`, `qq`, `score`, `balance`, `status`, `last_sign_in_date`)
VALUES ('$用户名', '$密码', '$QQ', 100, 0.00, 'active', CURRENT_DATE);";
if (!@数据库运行($语句)) {
die("Error:系统错误");
die("<script>window.location.href = '/';</script>");
} else {
$_SESSION["username"] = $用户名;
die("<script>window.location.href = '/Dashboard';</script>");
}
} else {
$_SESSION["username"] = $用户名;
die("<script>window.location.href = '/Dashboard';</script>");
}
} else {
die("<script>window.location.href = '/';</script>");
}