Skip to content

Commit

Permalink
Merge pull request #152 from ilvsx/fix/AdminBaseApiSetApiRecord
Browse files Browse the repository at this point in the history
fix: 动态 api 中统一模板的多个配置返回结果不变
  • Loading branch information
slowlyo authored Sep 27, 2024
2 parents 8d7be77 + 13459ec commit b8b1f1a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Controllers/AdminApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ public function index()
return $this->response()->success();
}

return app($api->template)->handle();
return app($api->template)->setApiRecord($api)->handle();
}
}
7 changes: 7 additions & 0 deletions src/Support/Apis/AdminBaseApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ public function getApiRecord()
return self::$apiRecord;
}

public function setApiRecord($apiRecord)
{
self::$apiRecord = $apiRecord;

return $this;
}

/**
* 获取接口参数, 可以通过传入 xxx.xxx 的方式获取指定参数
*
Expand Down

0 comments on commit b8b1f1a

Please sign in to comment.