v7.0.0 release
This commit is contained in:
1 parent
0e7fa04b03
commit
c4ea9a6cd1
3582 files changed
+626189
-160151
No files matched your search
@@ -22,7 +22,7 @@ class UserResource extends BaseApiResource
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
$data = [
|
||||
'uuid' => $this->getValue('uuid'),
|
||||
'name' => $this->getValue('name'),
|
||||
'nickname' => $this->getValue('nickname'),
|
||||
@@ -166,6 +166,30 @@ class UserResource extends BaseApiResource
|
||||
...$this->formatTimestamps(),
|
||||
...$this->resourceMeta($request),
|
||||
];
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* 인증 사용자(/api/auth/user, currentUser 출처) 응답용 배열을 반환합니다.
|
||||
*
|
||||
* 기본 toArray() 에 더해 core.user.filter_resource_data 필터를 적용해
|
||||
* 모듈이 자신의 데이터(결제 통화 등)를 병합할 수 있게 한다. 프론트(_user_base.json)는
|
||||
* 로그인 유저면 이 값으로 _global.preferredCurrency 를 초기화해
|
||||
* "로그인 시 계정 통화로 덮어씀"(D-LOGIN-CUR)을 구조적으로 충족한다.
|
||||
*
|
||||
* 주의: 이 메서드는 toArray() 외부에서 수동 호출되므로 $this->when() 대신
|
||||
* 삼항 연산자를 사용해야 한다. (toProfileArray/withAdminInfo 와 동일 규약)
|
||||
*
|
||||
* @param Request|null $request HTTP 요청
|
||||
* @return array<string, mixed> 모듈 필드가 병합된 인증 사용자 데이터
|
||||
*/
|
||||
public function toAuthArray(?Request $request = null): array
|
||||
{
|
||||
$data = $this->toArray($request ?? request());
|
||||
|
||||
// Filter 훅: 모듈이 자신의 데이터를 응답에 병합 (toProfileArray 와 동일)
|
||||
return HookManager::applyFilters('core.user.filter_resource_data', $data, $this->resource);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user