You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
586 B
15 lines
586 B
<?php
|
|
namespace app\appapi\middleware;
|
|
|
|
use think\middleware\AllowCrossDomain;
|
|
|
|
class AllowCrossDomainMiddleware extends AllowCrossDomain
|
|
{
|
|
// 加入自定义请求头参数 X-Token protected
|
|
$header = [
|
|
'Access-Control-Allow-Credentials' => 'true',
|
|
'Access-Control-Max-Age' => 1800,
|
|
'Access-Control-Allow-Methods' => 'GET, POST, PATCH, PUT, DELETE, OPTIONS',
|
|
'Access-Control-Allow-Headers' => 'Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-CSRF-TOKEN, X-Requested-With, X-Token',
|
|
];
|
|
} |