'image/jpeg', 'jpeg' => 'image/jpeg', 'png' => 'image/png', 'gif' => 'image/gif', 'webp' => 'image/webp', 'svg' => 'image/svg+xml', 'css' => 'text/css', 'js' => 'application/javascript', 'json' => 'application/json', 'ico' => 'image/x-icon', ]; header('Content-Type: ' . ($mimeTypes[$ext] ?? 'application/octet-stream')); header('Content-Length: ' . filesize($filePath)); header('Cache-Control: public, max-age=31536000'); readfile($filePath); exit; } // 所有请求统一交由 index.php 处理 require_once __DIR__ . '/public/index.php';