123456789101112131415161718192021222324252627282930313233 |
- <?php
- namespace think;
- $i=strpos($_SERVER['REQUEST_URI'],'/bmap/');
- if($i!==false){
- if(isset($_SERVER["HTTP_REFERER"])){
- $url= parse_url($_SERVER["HTTP_REFERER"]);
- header('Access-Control-Allow-Origin:'.$url['scheme'].'://'.$url['host'].(isset($url['port'])?(':'.$url['port']):''));
- header('Access-Control-Allow-Credentials:true');
- }
- echo file_get_contents('https://api.map.baidu.com/'.substr($_SERVER['REQUEST_URI'], $i+6));exit;
- }
- require __DIR__ . '/../vendor/autoload.php';
- $http = (new App())->http;
- $response = $http->run();
- $response->send();
- $http->end($response);
|