fix(studio.resource): 兼容灰度图为数组

This commit is contained in:
李东云
2022-11-09 07:58:56 +00:00
parent 8d0cf2617b
commit b0a40c4615

View File

@@ -33,11 +33,11 @@ class Grayscale extends JsonResource
public function toArray(): array
{
return [
'id' => $this->id,
'nameZh' => $this->nameZh,
'nameEn' => $this->nameEn,
'path' => $this->path,
'pathPreview' => $this->pathPreview,
'id' => $this->id ?? $this->resource['id'],
'nameZh' => $this->nameZh ?? $this->resource['nameZh'],
'nameEn' => $this->nameEn ?? $this->resource['nameEn'],
'path' => $this->path ?? $this->resource['path'],
'pathPreview' => $this->pathPreview ?? $this->resource['pathPreview'],
];
}
}