fix(api): 修复空action参数处理并添加伪静态规则

修复当action参数为空时API根路径的错误处理
添加.htaccess伪静态规则以支持更友好的API URL
This commit is contained in:
2025-07-12 17:17:27 +08:00
parent 91cc01bd67
commit da631ff924
2 changed files with 8 additions and 2 deletions

View File

@@ -6,7 +6,7 @@ header('Content-Type: application/json');
$requestMethod = $_SERVER['REQUEST_METHOD'];
// API根路径处理 - 返回可用端点信息
if (!isset($_GET['action'])) {
if (!isset($_GET['action']) || $_GET['action'] === '') {
http_response_code(200);
echo json_encode([
'status' => 'success',