超管后台 - 调整所有的fetch 请求为后封装的 apiRequest,实现cookie 跨域

This commit is contained in:
柳清爽
2025-04-28 15:39:05 +08:00
parent 0eb629df70
commit 35341335d3
15 changed files with 459 additions and 475 deletions

View File

@@ -12,9 +12,9 @@
use think\facade\Route;
// 允许跨域
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Origin: ' . (isset($_SERVER['HTTP_ORIGIN']) ? $_SERVER['HTTP_ORIGIN'] : '*'));
header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS, PATCH');
header('Access-Control-Allow-Headers: Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With, X-Token, X-Api-Token');
header('Access-Control-Allow-Headers: Cookie, Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, X-Requested-With, X-Token, X-Api-Token');
header('Access-Control-Max-Age: 1728000');
header('Access-Control-Allow-Credentials: true');