作者 lyh

gx

... ... @@ -4,7 +4,6 @@ namespace App\Http\Controllers\File;
use App\Enums\Common\Code;
use App\Models\File\File;
use App\Models\File\Image as ImageModel;
use App\Models\Project\Project;
use App\Services\CosService;
use Illuminate\Http\Exceptions\HttpResponseException;
... ...
... ... @@ -52,18 +52,6 @@ class ImageController extends Controller
public function __construct()
{
$http_origin = "*";
if(isset($_SERVER['HTTP_ORIGIN'])){
$http_origin = $_SERVER['HTTP_ORIGIN'];
}
header("Access-Control-Allow-Origin:".$http_origin);
header('Access-Control-Allow-Methods:POST,GET'); //支持的http 动作
header('Access-Control-Allow-Credentials: true');
header('Access-Control-Max-Age: 1000');
header('Access-Control-Allow-Headers:Origin, X-Requested-With, Content-Type, Accept, Authorization, token'); //响应头 请按照自己需求添加。
if (strtolower($_SERVER['REQUEST_METHOD']) == 'options') {
exit;
}
$this->request = request();
$this->token = $this->request->header('token');
$this->cache = Cache::get($this->token);
... ...