'13012345678', 'driver' => '13012345679', 'agent' => '13012345680', ]; public function __construct(private readonly string $phone) { } public static function enabled(): bool { return config('mini_api.test_phone_login', false) === true; } public function exchange(string $code): array { if (!self::enabled()) { throw new ApiException(50301, '测试手机号登录未开启', 503); } if (!in_array($this->phone, self::PHONES, true)) { throw new ApiException(40102, '测试手机号错误', 401); } return ['appid' => self::APP_ID, 'openid' => $this->phone]; } }