header("Access-Control-Allow-Origin: http://localhost:8080"); // 允许你的前端来源 header("Access-Control-Allow-Methods: GET, POST, OPTIONS"); // 允许的请求方法 header("Access-Control-Allow-Headers: Content-Type, Authorization"); // 允许的请求头 header("Access-Control-Allow-Credentials: true"); // 如果你需要传递 cookie 或 token,才加上这一行
欢迎注册成为会员,会员享受专属服务!