|
@@ -52,18 +52,6 @@ class ImageController extends Controller |
|
@@ -52,18 +52,6 @@ class ImageController extends Controller |
|
52
|
|
52
|
|
|
53
|
public function __construct()
|
53
|
public function __construct()
|
|
54
|
{
|
54
|
{
|
|
55
|
- $http_origin = "*";
|
|
|
|
56
|
- if(isset($_SERVER['HTTP_ORIGIN'])){
|
|
|
|
57
|
- $http_origin = $_SERVER['HTTP_ORIGIN'];
|
|
|
|
58
|
- }
|
|
|
|
59
|
- header("Access-Control-Allow-Origin:".$http_origin);
|
|
|
|
60
|
- header('Access-Control-Allow-Methods:POST,GET'); //支持的http 动作
|
|
|
|
61
|
- header('Access-Control-Allow-Credentials: true');
|
|
|
|
62
|
- header('Access-Control-Max-Age: 1000');
|
|
|
|
63
|
- header('Access-Control-Allow-Headers:Origin, X-Requested-With, Content-Type, Accept, Authorization, token'); //响应头 请按照自己需求添加。
|
|
|
|
64
|
- if (strtolower($_SERVER['REQUEST_METHOD']) == 'options') {
|
|
|
|
65
|
- exit;
|
|
|
|
66
|
- }
|
|
|
|
67
|
$this->request = request();
|
55
|
$this->request = request();
|
|
68
|
$this->token = $this->request->header('token');
|
56
|
$this->token = $this->request->header('token');
|
|
69
|
$this->cache = Cache::get($this->token);
|
57
|
$this->cache = Cache::get($this->token);
|