|
- <?php
- header("Access-Control-Allow-Origin:*");
- //载入配置文件和连接数据库
- require_once 'Common/Mysql.php';
- require_once 'dictionary.php';
- require_once 'Common/sinaAPI.php';
- date_default_timezone_set('PRC');
- $user_id = isset($_COOKIE['user_id']) ? $_COOKIE['user_id'] : '';//getUserId()
- if (!$user_id) {
- echo json_encode(array("code" => 1, "iflogin" => 1, "info" => "用户未登录"));
- exit;
- }
- $pdo = conn();
- $type = $_POST['type'];
- $type = explode("_", $type);
- //根据需求调用相应的文件获得数据
- require_once 'Model/' . $type[0] . '/' . $type[1] . '.php';
- ?>
|