first commit
This commit is contained in:
21
金壶/ydyd_service/application/http/middleware/CrossDomain.php
Normal file
21
金壶/ydyd_service/application/http/middleware/CrossDomain.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace app\http\middleware;
|
||||
|
||||
|
||||
use think\facade\Request;
|
||||
|
||||
class CrossDomain
|
||||
{
|
||||
public function handle($request, \Closure $next)
|
||||
{
|
||||
header('Access-Control-Allow-Origin:*');
|
||||
header('Access-Control-Allow-Methods:*');
|
||||
header('Access-Control-Allow-Headers:*');
|
||||
header('Access-Control-Allow-Credentials:false');
|
||||
if (Request::isOptions()) {
|
||||
return response('',200);
|
||||
}
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user