优化/api/game/playStart接口
This commit is contained in:
@@ -71,7 +71,7 @@ class GameController extends OpenController
|
||||
{
|
||||
$userId = (int) ($request->player_id ?? 0);
|
||||
$direction = $request->post('direction');
|
||||
if (!in_array($direction, [0, 1], true)) {
|
||||
if (!in_array($direction, ['0', '1'], true)) {
|
||||
return $this->fail('direction 必须为 0 或 1', ReturnCode::PARAMS_ERROR);
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ class GameController extends OpenController
|
||||
|
||||
try {
|
||||
$logic = new PlayStartLogic();
|
||||
$data = $logic->run($userId, $direction);
|
||||
$data = $logic->run($userId, (int)$direction);
|
||||
return $this->success($data);
|
||||
} catch (ApiException $e) {
|
||||
return $this->fail($e->getMessage(), ReturnCode::BUSINESS_ERROR);
|
||||
|
||||
Reference in New Issue
Block a user