修复跨域报错

This commit is contained in:
2026-03-30 12:13:20 +08:00
parent 09ef8edd15
commit 8669a20dc8
2 changed files with 2 additions and 2 deletions

View File

@@ -30,7 +30,7 @@ class AllowCrossDomain implements MiddlewareInterface
'Access-Control-Allow-Credentials' => 'true', 'Access-Control-Allow-Credentials' => 'true',
'Access-Control-Max-Age' => '1800', 'Access-Control-Max-Age' => '1800',
'Access-Control-Allow-Methods' => 'GET, POST, PUT, DELETE, PATCH, OPTIONS', 'Access-Control-Allow-Methods' => 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
'Access-Control-Allow-Headers' => 'Content-Type, Authorization, batoken, ba-user-token, think-lang, lang', 'Access-Control-Allow-Headers' => 'Content-Type, Authorization, batoken, ba-user-token, think-lang, lang, server',
]; ];
$origin = $request->header('origin'); $origin = $request->header('origin');
if (is_array($origin)) { if (is_array($origin)) {

View File

@@ -5,7 +5,7 @@
return [ return [
// 允许跨域访问的域名(* 表示任意;开发可用 *,生产建议填具体域名) // 允许跨域访问的域名(* 表示任意;开发可用 *,生产建议填具体域名)
'cors_request_domain' => '*,playx-admin.cjdhr.top', 'cors_request_domain' => '*',
// 是否开启会员登录验证码 // 是否开启会员登录验证码
'user_login_captcha' => false, 'user_login_captcha' => false,
// 是否开启管理员登录验证码 // 是否开启管理员登录验证码