feat: 加入跨域处理

This commit is contained in:
2025-01-13 11:45:42 +08:00
parent 92b7c11b88
commit e2028f5b85
2 changed files with 15 additions and 1 deletions

View File

@@ -29,7 +29,9 @@
"topthink/think-view": "^2.0", "topthink/think-view": "^2.0",
"topthink/think-captcha": "^3.0", "topthink/think-captcha": "^3.0",
"thans/tp-jwt-auth": "^2.2", "thans/tp-jwt-auth": "^2.2",
"topthink/think-throttle": "^2.0" "topthink/think-throttle": "^2.0",
"intervention/image": "^3.10",
"topthink/think-cors": "^1.0"
}, },
"require-dev": { "require-dev": {
"symfony/var-dumper": ">=4.2", "symfony/var-dumper": ">=4.2",

12
config/cors.php Normal file
View File

@@ -0,0 +1,12 @@
<?php
return [
'paths' => [],
'allowed_origins' => ['*'],
'allowed_origins_patterns' => [],
'allowed_methods' => ['*'],
'allowed_headers' => ['*'],
'exposed_headers' => [],
'max_age' => 0,
'supports_credentials' => true,
];