修复 第三方登录 图片加载

This commit is contained in:
Edward Yang 2022-11-02 18:13:09 +08:00
parent 77b3167d36
commit d8abb038b0
1 changed files with 4 additions and 4 deletions

View File

@ -29,10 +29,6 @@ class ImageService
{
$this->image = $image ?: self::PLACEHOLDER_IMAGE;
$this->imagePath = public_path($this->image);
if (!file_exists($this->imagePath)) {
$this->image = self::PLACEHOLDER_IMAGE;
$this->imagePath = public_path($this->image);
}
}
@ -68,6 +64,10 @@ class ImageService
public function resize(int $width = 100, int $height = 100): string
{
try {
if (!file_exists($this->imagePath)) {
$this->image = self::PLACEHOLDER_IMAGE;
$this->imagePath = public_path($this->image);
}
if (!file_exists($this->imagePath)) {
return '';
}