diff --git a/backend/app/controller/AuthController.php b/backend/app/controller/AuthController.php index 79b6f7f..b5cd114 100644 --- a/backend/app/controller/AuthController.php +++ b/backend/app/controller/AuthController.php @@ -287,7 +287,12 @@ class AuthController extends BaseController ]); // 构建扫码登录 URL(使用数据库中配置的回调地址) - $callbackUrl = $feishuApp->mobile_callback_url ?? request()->scheme() . '://' . request()->host() . '/login/callback'; + if ($feishuApp->mobile_callback_url) { + $callbackUrl = $feishuApp->mobile_callback_url; + } else { + $scheme = request()->isSecure() ? 'https' : 'http'; + $callbackUrl = $scheme . '://' . request()->host() . '/login/callback'; + } $redirectUri = urlencode($callbackUrl); $authUrl = "https://passport.feishu.cn/suite/passport/oauth/authorize?client_id={$feishuApp->app_id}&redirect_uri={$redirectUri}&response_type=code&state={$loginSession->id}"; diff --git a/backend/app/service/ApprovalService.php b/backend/app/service/ApprovalService.php index 94984c1..ecd6a81 100644 --- a/backend/app/service/ApprovalService.php +++ b/backend/app/service/ApprovalService.php @@ -502,7 +502,13 @@ class ApprovalService */ private function getDetailUrl(ApprovalOrder $order): string { - $baseUrl = config('feishu_notification.base_url') ?? request()->scheme() . '://' . request()->host(); + $baseUrl = config('feishu_notification.base_url'); + + // 如果没有配置,使用当前请求构建 + if (!$baseUrl) { + $scheme = request()->isSecure() ? 'https' : 'http'; + $baseUrl = $scheme . '://' . request()->host(); + } // 统一使用审批详情页,不再跳转到具体业务模块的详情页 return "{$baseUrl}/approval/detail/{$order->id}";