|
- <?php
- //Author:fuhc
- //Date:20160906
- //Api入口
-
-
-
- header("Access-Control-Allow-Origin:*");
- // header('Access-Control-Allow-Headers: X-Requested-With');
- // header("Content-type: text/html; charset=utf-8");
- require_once 'HTdebug.php';
-
-
- //获取接口目录 请求类型 POST GET
- // $type = isset($_POST['type'])?$_POST['type']:(isset($_GET['type'])?$_GET['type']:"6");
- $type = isset($_REQUEST['type'])?$_REQUEST['type']:"6";
- if($type=="6"){
- $data['code']="6";
- $data['info']="缺少type参数";
- echo json_encode($data);
- return;
- }
- $type = str_replace('_', '/', $type);
- //根据需求调用相应的文件获得数据
- $path='Api/'.$type.'.php';
-
-
-
- require_once $path;
-
|