diff --git a/backend/app/controller/AuthController.php b/backend/app/controller/AuthController.php index b5cd114..6a0e088 100644 --- a/backend/app/controller/AuthController.php +++ b/backend/app/controller/AuthController.php @@ -290,7 +290,8 @@ class AuthController extends BaseController if ($feishuApp->mobile_callback_url) { $callbackUrl = $feishuApp->mobile_callback_url; } else { - $scheme = request()->isSecure() ? 'https' : 'http'; + // 检查反向代理的协议头 + $scheme = request()->header('x-forwarded-proto') ?? request()->header('x-scheme') ?? 'https'; $callbackUrl = $scheme . '://' . request()->host() . '/login/callback'; } $redirectUri = urlencode($callbackUrl); diff --git a/backend/app/service/ApprovalService.php b/backend/app/service/ApprovalService.php index ecd6a81..79b8530 100644 --- a/backend/app/service/ApprovalService.php +++ b/backend/app/service/ApprovalService.php @@ -506,8 +506,10 @@ class ApprovalService // 如果没有配置,使用当前请求构建 if (!$baseUrl) { - $scheme = request()->isSecure() ? 'https' : 'http'; - $baseUrl = $scheme . '://' . request()->host(); + // 检查反向代理的协议头 + $scheme = request()->header('x-forwarded-proto') ?? request()->header('x-scheme') ?? 'https'; + $host = request()->host(); + $baseUrl = $scheme . '://' . $host; } // 统一使用审批详情页,不再跳转到具体业务模块的详情页