支付宝接口

This commit is contained in:
wanyongkang
2020-10-11 19:23:42 +08:00
parent ce067b91dc
commit 517b026891
1110 changed files with 139880 additions and 95 deletions

View File

@@ -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'];