支付宝接口
This commit is contained in:
@@ -24,6 +24,7 @@ class Fastphp
|
||||
public function run(){
|
||||
global $is_script;
|
||||
spl_autoload_register(array($this,'loadClass'));
|
||||
$this->origin();
|
||||
$this->setReporting();
|
||||
$this->unregisterGlobals();
|
||||
$this->setDbConfig();
|
||||
@@ -32,6 +33,20 @@ class Fastphp
|
||||
}
|
||||
}
|
||||
|
||||
//跨域请求处理
|
||||
public function origin(){
|
||||
$allow_origin = $this->config['origin'];//跨域访问的时候才会存在此字段
|
||||
$origin = isset($_SERVER['HTTP_ORIGIN']) ? $_SERVER['HTTP_ORIGIN'] : '';
|
||||
if (in_array($origin, $allow_origin)) {
|
||||
header('Access-Control-Allow-Origin:' . $origin);
|
||||
header("Access-Control-Allow-Methods: *");
|
||||
header('Access-Control-Allow-Headers:*');
|
||||
header("Access-Control-Allow-Credentials: true");
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
//路由处理
|
||||
public function route(){
|
||||
$controllerName = $this->config['defaultController'];
|
||||
|
||||
Reference in New Issue
Block a user