<?php // 允许跨域 header('Access-Control-Allow-Origin:*');//允许跨域 header("Access-Control-Allow-Headers:*"); header("Access-Control-Allow-Methods: GET,POST,OPTION"); //if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') { // header('Access-Control-Allow-Headers:platform,lang,x-requested-with,content-type,token');//浏览器页面ajax跨域请求会请求2次,第一次会发送OPTIONS预请求,不进行处理,直接exit返回,但因为下次发送真正的请求头部有带token,所以这里设置允许下次请求头带token否者下次请求无法成功 // exit("ok"); //} // // ///**======设置跨域cookies传递===开始=====*/ //header("Access-Control-Allow-Methods: GET,POST"); //header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Set-cookies"); //header("Access-Control-Allow-Credentials:true");//如果服务端不设置响应头,响应会被忽略不可用;同时,服务端需指定一个域名(Access-Control-Allow-Origin:www.zawaliang.com),而不能使用泛型(Access-Control-Allow-Origin: *) //header("Access-Control-Max-Age:60"); //$origin = isset($_SERVER['HTTP_ORIGIN']) ? $_SERVER['HTTP_ORIGIN'] : '*'; //header('Access-Control-Allow-Origin:'.$origin); //header("Access-Control-Allow-Headers:platform,lang,Origin, X-Requested-With, Content-Type, Accept, Set-cookies"); /**======设置跨域cookies传递===结束=====*/ // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- // | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Author: liu21st <liu21st@gmail.com> // +---------------------------------------------------------------------- // [ 应用入口文件 ] // 定义应用目录 define('APP_PATH', __DIR__ . '/../application/'); // 判断是否安装 if (!is_file(APP_PATH . 'admin/command/Install/install.lock')) { header("location:./install.php"); exit; } // 加载框架引导文件 require __DIR__ . '/../thinkphp/start.php';