resolve($request); } catch (PlayerAuthenticationException $e) { // msg:多语言用户提示;code / httpStatus:仍来自异常内业务定义 return ApiResponse::error( LotteryMessage::sso($request, $e->lotteryCode), $e->lotteryCode, null, $e->httpStatus, ); } // 使用 attributes,避免与 Laravel 内置 input 混淆 $request->attributes->set('lottery_player', $player); return $next($request); } }