travel/service/app/middleware/wechatAuth.php

21 lines
666 B
PHP
Raw Normal View History

2024-10-21 17:14:32 +08:00
<?php
namespace app\middleware;
use Firebase\JWT\JWT;
use Firebase\JWT\ExpiredException;
use Firebase\JWT\Key;
use Webman\MiddlewareInterface;
use Webman\Http\Response;
use Webman\Http\Request;
class wechatAuth implements MiddlewareInterface
{
public function process(Request $request, callable $next): Response {
// 设置允许跨域的来源
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS");
header("Access-Control-Allow-Headers: Content-Type,Referer, Authorization, X-Requested-With,User-Agent,Token,Accept-Language");
return $next($request);
}
}