20 lines
468 B
PHP
20 lines
468 B
PHP
<?php
|
|
include 'core/config.php';
|
|
include 'core/clean.php';
|
|
|
|
// TODO: cookie manage
|
|
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';
|
|
}
|
|
|
|
header("Content-Type: application/json");
|
|
include 'includes/' . $api_class . '/' . $api . '.php';
|
|
|