You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

18 lines
592 B

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