Merge branch 'master' of http://app.git.1nww.com:8188/gitlab-instance-db4ab2e7/cxhxy
This commit is contained in:
commit
f733092ed5
@ -12,6 +12,18 @@
|
||||
// [ 应用入口文件 ]
|
||||
namespace think;
|
||||
|
||||
|
||||
header('Content-Type: text/html;charset=utf-8');
|
||||
header('Access-Control-Allow-Origin:*'); // *代表允许任何网址请求
|
||||
header('Access-Control-Allow-Methods:POST,GET,OPTIONS,DELETE,PUT'); // 允许请求的类型
|
||||
header('Access-Control-Allow-Credentials: true'); // 设置是否允许发送 cookies
|
||||
header('Access-Control-Allow-Headers: Content-Type,Content-Length,Accept-Encoding,X-Requested-with, Origin,x-csrf,Authorization,x-app-client-id,x-app-platform,x-app-version,x-csrf,x-mch-id,x-requested-time,x-requested-with,Language,access_token'); // 设置允许自定义请求头的字段
|
||||
// comment out the following two lines when deployed to production
|
||||
if($_SERVER['REQUEST_METHOD'] == 'OPTIONS'){
|
||||
echo json_encode(['code'=>'0','msg'=>'ok']);
|
||||
exit();
|
||||
}
|
||||
|
||||
// 检测PHP环境
|
||||
//if (version_compare(PHP_VERSION, '7.4.0', '<')) die('require PHP > 7.1.0 !');
|
||||
// 检测php版本号
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user