Files
finance_app/config/cors.php
henry yo 1b771167cf
All checks were successful
Laravel-Oracle-Deploy / redeploy (push) Successful in 3s
fix: change config
2026-06-25 22:13:19 +08:00

40 lines
1.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
return [
/*
|--------------------------------------------------------------------------
| Cross-Origin Resource Sharing (CORS) Configuration
|--------------------------------------------------------------------------
|
| Here you may configure your settings for cross-origin resource sharing
| or "CORS". This determines what cross-origin operations may execute
| in web browsers. You are free to adjust these settings as needed.
|
*/
// 🎯 1. 確保包含了你前端呼叫的所有路徑前綴
'paths' => ['api/*', 'v1/*', 'auth/*', 'sanctum/csrf-cookie'],
'allowed_methods' => ['*'],
// 🎯 2. 精準放行本地端 Vite5173與雲端生產網域
'allowed_origins' => [
'https://fin-buddy.duckdns.org',
'http://localhost:5173',
'http://127.0.0.1:5173'
],
'allowed_origins_patterns' => [],
'allowed_headers' => ['*'],
'exposed_headers' => [],
'max_age' => 0,
// 🎯 3. 超級關鍵因為你在本地測試有帶登入態Cookie/Session這項一定要是 true
'supports_credentials' => true,
];