2024-10-29 13:13:37 +08:00
|
|
|
<?php
|
|
|
|
include 'core/config.php';
|
|
|
|
include 'core/clean.php';
|
2024-10-30 12:59:20 +08:00
|
|
|
|
|
|
|
// TODO: cookie manage
|
2024-10-29 13:13:37 +08:00
|
|
|
session_start();
|
|
|
|
|
|
|
|
// 获取参数
|
|
|
|
$api_class = isset($_GET['class']) ? sanitizeInput($_GET['class']) : '';
|
|
|
|
$api = isset($_GET['api']) ? sanitizeInput($_GET['api']) : '';
|
|
|
|
|
|
|
|
// 如果不是 public api 则启用路由
|
|
|
|
if ($api_class != 'public') {
|
|
|
|
include 'core/login_router.php';
|
|
|
|
}
|
|
|
|
|
2024-10-30 12:59:20 +08:00
|
|
|
header("Content-Type: application/json");
|
|
|
|
include 'includes/' . $api_class . '/' . $api . '.php';
|
2024-10-29 13:13:37 +08:00
|
|
|
|