feat: 支持上传及查看高清原图自定义头像
This commit is contained in:
+4
-1
@@ -141,7 +141,10 @@ class User extends Authenticatable
|
||||
$hf = (string) $this->usersf;
|
||||
if (str_starts_with($hf, 'storage/')) {
|
||||
$path = substr($hf, 8); // 去除 'storage/' 前缀
|
||||
\Illuminate\Support\Facades\Storage::disk('public')->delete($path);
|
||||
$info = pathinfo($path);
|
||||
$origPath = $info['dirname'].'/'.$info['filename'].'_original.'.($info['extension'] ?? 'jpg');
|
||||
|
||||
\Illuminate\Support\Facades\Storage::disk('public')->delete([$path, $origPath]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user