diff --git a/api/header-control.php b/api/header-control.php index 79cbde6..dbc6c38 100644 --- a/api/header-control.php +++ b/api/header-control.php @@ -9,10 +9,4 @@ header('Content-Type: application/json;charset=utf-8'); // 获取数据(获取数据库信息) include($_SERVER['DOCUMENT_ROOT'].'/setting.inc.php'); -include($_SERVER['DOCUMENT_ROOT'].'/plugins/sql_conn.php'); - -// 日志记录 - // 日志记录时间 - $logs_time = date("Y-m-d H:i:s"); - // 日志记录用户使用的IP情况 - $logs_ip = $_SERVER["REMOTE_ADDR"]; \ No newline at end of file +include($_SERVER['DOCUMENT_ROOT'].'/plugins/sql_conn.php'); \ No newline at end of file diff --git a/api/main/index.php b/api/main/index.php new file mode 100644 index 0000000..c6592c5 --- /dev/null +++ b/api/main/index.php @@ -0,0 +1,70 @@ +text; + +// 构建函数 +if (empty($key)) { + // 循环输出内容 + $result_info = mysqli_query($conn,"SELECT * FROM ".$setting['SQL_DATA']['system_info']); + while ($result_info_object = mysqli_fetch_object($result_info)) { + if ($result_info_object->info !== 'system_key') { + $array[$result_info_object->info] = array( + 'info'=>$result_info_object->info, + 'text'=>$result_info_object->text, + 'load'=>$result_info_object->load, + ); + } + } + // 编译数据 + $data = array( + 'output'=>'SUCCESS', + 'code'=>200, + 'info'=>'输出成功', + 'data'=>$array, + ); + // 输出数据 + echo json_encode($data,JSON_UNESCAPED_UNICODE); +} else { + if ($key == $sql_key) { + // 循环输出内容 + $result_info = mysqli_query($conn,"SELECT * FROM ".$setting['SQL_DATA']['system_info']); + while ($result_info_object = mysqli_fetch_object($result_info)) { + $array[$result_info_object->info] = array( + 'info'=>$result_info_object->info, + 'text'=>$result_info_object->text, + 'load'=>$result_info_object->load, + ); + } + // 编译数据 + $data = array( + 'output'=>'SUCCESS', + 'code'=>200, + 'info'=>'输出成功', + 'data'=>$array, + ); + // 输出数据 + echo json_encode($data,JSON_UNESCAPED_UNICODE); + } else { + // 编译数据 + $data = array( + 'output'=>'KEY_ERROR', + 'code'=>403, + 'info'=>'密钥错误' + ); + // 输出数据 + echo json_encode($data,JSON_UNESCAPED_UNICODE); + header("HTTP/1.1 403 Forbidden"); + } +} \ No newline at end of file diff --git a/api/main/mirrors.php b/api/main/mirrors.php new file mode 100644 index 0000000..8588144 --- /dev/null +++ b/api/main/mirrors.php @@ -0,0 +1,88 @@ +text; + +// 数据库信息获取 +if (!empty($key)) { + if ($key == $sql_key) { + // 从数据库获取信息 + $result_info = mysqli_query($conn,"SELECT * FROM ".$setting['SQL_DATA']['system_info']." WHERE info='web_mirror'"); + $result_info_object = mysqli_fetch_object($result_info); + // 整理参数 + if ($result_info_object->text == 'akass') { + $info = array( + 'bootstrap_css'=>'https://npm.akass.cn/bootstrap@5.1.3/dist/css/bootstrap.css', + 'bootstrap_icon'=>'https://npm.akass.cn/bootstrap-icons@1.8.2/font/bootstrap-icons.css', + 'bootstrap_js'=>'https://npm.akass.cn/bootstrap@5.1.3/dist/js/bootstrap.min.js', + 'bootstrap_bundle_js'=>'https://npm.akass.cn/bootstrap@5.1.3/dist/js/bootstrap.bundle.js', + 'jquery'=>'https://npm.akass.cn/jquery@3.2.1/dist/jquery.min.js', + 'qweather'=>'https://npm.akass.cn/qweather-icons@1.1.1/font/qweather-icons.css' + ); + } elseif ($result_info_object->text == 'jsdelivr') { + $info = array( + 'bootstrap_css'=>'https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css', + 'bootstrap_icon'=>'https://cdn.jsdelivr.net/npm/bootstrap-icons@1.8.2/font/bootstrap-icons.css', + 'bootstrap_js'=>'https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.min.js', + 'bootstrap_bundle_js'=>'https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js', + 'jquery'=>'https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js', + 'qweather'=>'https://cdn.jsdelivr.net/npm//qweather-icons@1.1.1/font/qweather-icons.css' + ); + } else { + $info = array( + 'bootstrap_css'=>'/src/css/bootstrap.min.css', + 'bootstrap_icon'=>'/src/css/bootstrap-icons.css', + 'bootstrap_js'=>'/src/js/bootstrap.min.js', + 'bootstrap_bundle_js'=>'/src/js/bootstrap.bundle.min.js', + 'jquery'=>'/src/js/jquery.min.js', + 'qweather'=>'/src/css/qweather-icons.css' + ); + } + // 编译数据 + $data = array( + 'output'=>'SUCCESS', + 'code'=>200, + 'info'=>'数据输出成功', + 'data'=>array( + 'type'=>$result_info_object->text, + 'info'=>$info, + ), + ); + // 输出数据 + echo json_encode($data,JSON_UNESCAPED_UNICODE); + } else { + // 编译数据 + $data = array( + 'output'=>'SSID_ERROR', + 'code'=>403, + 'info'=>'参数 Query[ssid] 密钥错误' + ); + // 输出数据 + echo json_encode($data,JSON_UNESCAPED_UNICODE); + header("HTTP/1.1 403 Forbidden"); + } + // 关闭数据库 + mysqli_free_result($result_key); + mysqli_close($conn); +} else { + // 编译数据 + $data = array( + 'output'=>'KEY_EMPTY', + 'code'=>403, + 'info'=>'参数 Query[KEY] 缺失' + ); + // 输出数据 + echo json_encode($data,JSON_UNESCAPED_UNICODE); + header("HTTP/1.1 403 Forbidden"); +} \ No newline at end of file diff --git a/auth.php b/auth.php index 6fe115b..939845b 100644 --- a/auth.php +++ b/auth.php @@ -12,11 +12,12 @@ $callback = htmlspecialchars($_GET['callback']); -