feat: enhance player authentication and agent management features
Some checks failed
lotterLaravel CI / test (push) Has been cancelled
Some checks failed
lotterLaravel CI / test (push) Has been cancelled
- Updated AGENTS.md to clarify player interface bindings and agent account restrictions. - Improved PlayerAuthLoginController to include captcha verification for player login. - Enhanced AdminPlayerIndexController with permission checks for admin users. - Refactored AdminPlayerStoreController to enforce agent node restrictions for non-super admins. - Introduced new error codes for player authentication failures and updated related services. - Enhanced validation rules for agent profiles to include settlement cycle options. - Improved AdminCaptchaService to support separate scopes for admin and player captcha handling. - Updated various services to ensure proper credit management and settlement processes.
This commit is contained in:
@@ -2,19 +2,35 @@
|
||||
|
||||
namespace App\Http\Controllers\Api\V1\Player;
|
||||
|
||||
use App\Exceptions\PlayerAuthenticationException;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\Player\PlayerAuthLoginRequest;
|
||||
use App\Lottery\ErrorCode;
|
||||
use App\Services\AdminCaptchaService;
|
||||
use App\Services\Player\PlayerNativeAuthService;
|
||||
use App\Support\ApiResponse;
|
||||
use App\Support\LotteryMessage;
|
||||
use App\Exceptions\PlayerAuthenticationException;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
/** POST /api/v1/player/auth/login — 代理线下玩家账号密码登录 */
|
||||
final class PlayerAuthLoginController extends Controller
|
||||
{
|
||||
public function __invoke(PlayerAuthLoginRequest $request, PlayerNativeAuthService $auth): JsonResponse
|
||||
{
|
||||
public function __invoke(
|
||||
PlayerAuthLoginRequest $request,
|
||||
PlayerNativeAuthService $auth,
|
||||
AdminCaptchaService $captcha,
|
||||
): JsonResponse {
|
||||
$data = $request->validated();
|
||||
|
||||
if (! $captcha->verify($data['captcha_key'], $data['captcha_code'], AdminCaptchaService::SCOPE_PLAYER)) {
|
||||
return ApiResponse::error(
|
||||
LotteryMessage::sso($request, ErrorCode::PlayerCaptchaInvalid->value),
|
||||
ErrorCode::PlayerCaptchaInvalid->value,
|
||||
null,
|
||||
422,
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
$data = $auth->login(
|
||||
(string) $request->validated('site_code', ''),
|
||||
|
||||
Reference in New Issue
Block a user