feat: 支持上传及查看高清原图自定义头像

This commit is contained in:
2026-04-02 17:07:24 +08:00
parent caf4742dd8
commit b4d6e0e23b
5 changed files with 44 additions and 9 deletions
+4 -1
View File
@@ -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]);
}
}