Browse Source

sunguidong

zhangguidong 2 years ago
parent
commit
3683cda463
2 changed files with 7 additions and 2 deletions
  1. 6 1
      index.php
  2. 1 1
      runtime/cache/f4/49c786c4270f44d302ca37a7ba373c.php

+ 6 - 1
index.php

@@ -14,7 +14,12 @@ namespace think;
 if (version_compare(PHP_VERSION, '7.1.0', '<'))
     die('require PHP > 7.1.0 !');
 
-
+// 检测PHP环境  允许前端跨域请求
+header("Access-Control-Allow-Origin:*");
+// 响应类型
+header('Access-Control-Allow-Methods:GET, POST, PUT, DELETE');
+// 响应头设置
+header('Access-Control-Allow-Headers:x-requested-with, content-type');
 
 
 if (! file_exists('./install.lock')) {

+ 1 - 1
runtime/cache/f4/49c786c4270f44d302ca37a7ba373c.php

@@ -1,4 +1,4 @@
 <?php
 //000000000000
  exit();?>
-1660720976
+1660721036