💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
~~~ header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Methods: POST, GET, PUT, OPTIONS, DELETE'); //支持的http 动作 header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, x-access-sign, x-access-time'); if (request()->isOptions()) { exit(); } ~~~ 跨域中间件 public function handle($request, \Closure $next) { header("Access-Control-Allow-Origin: *"); header("Access-Control-Allow-Headers: Authorization, Origin, X-Requested-With, Content-Type,token, Accept, x-access-sign, x-access-time"); header("Access-Control-Allow-Methods: GET, POST, PATCH, PUT, DELETE"); if (strtoupper($request->method()) == "OPTIONS") { return response(); } return $next($request); }