This commit is contained in:
2026-03-10 18:45:36 +08:00
commit 3a9e6df891
679 changed files with 291867 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?php
/**
* Created by PhpStorm.
* User: wumin
* Date: 2019/3/29
* Time: 12:51
*/
namespace app\common\behavior;
use think\Exception;
use think\Response;
class CronRun
{
public function run(&$dispatch){
$host_name = isset($_SERVER['HTTP_ORIGIN']) ? $_SERVER['HTTP_ORIGIN'] : "*";
$headers = [
"Access-Control-Allow-Origin" => $host_name,
"Access-Control-Allow-Credentials" => 'true',
"Access-Control-Allow-Headers" => "x-token,x-uid,x-token-check,x-requested-with,content-type,Host"
];
if($dispatch instanceof Response) {
$dispatch->header($headers);
} else if($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
$dispatch['type'] = 'response';
$response = new Response('', 200, $headers);
$dispatch['response'] = $response;
}
}
}