This commit is contained in:
Your Name
2026-07-22 10:18:59 +08:00
parent 2530ddada6
commit 0fb03d0bca
618 changed files with 19445 additions and 3 deletions
+22
View File
@@ -0,0 +1,22 @@
<?php
namespace app\middleware;
use app\service\JwtService;
use think\Response;
class Cors
{
public function handle($request, \Closure $next)
{
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS');
header('Access-Control-Allow-Headers: Content-Type, Authorization');
if ($request->method(true) === 'OPTIONS') {
return Response::create('', 'html', 204);
}
return $next($request);
}
}