From 433fcc04a22b2bf704467cbf6f04e746737472b7 Mon Sep 17 00:00:00 2001 From: MSuMshk <2039814060@qq.com> Date: Sat, 27 Dec 2025 12:20:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=94=A8=E6=88=B7=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=A4=B4=E5=83=8F=E5=B9=B6=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Identity/Contracts/UserListItemDto.cs | 5 +++++ .../Handlers/BatchIdentityUserOperationCommandHandler.cs | 1 + .../Identity/Handlers/SearchIdentityUsersQueryHandler.cs | 1 + .../Storage/Services/FileStorageService.cs | 6 +++--- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Application/TakeoutSaaS.Application/Identity/Contracts/UserListItemDto.cs b/src/Application/TakeoutSaaS.Application/Identity/Contracts/UserListItemDto.cs index fb818b6..c3f0abc 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Contracts/UserListItemDto.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Contracts/UserListItemDto.cs @@ -31,6 +31,11 @@ public sealed record UserListItemDto /// public string DisplayName { get; init; } = string.Empty; + /// + /// 头像地址。 + /// + public string? Avatar { get; init; } + /// /// 手机号。 /// diff --git a/src/Application/TakeoutSaaS.Application/Identity/Handlers/BatchIdentityUserOperationCommandHandler.cs b/src/Application/TakeoutSaaS.Application/Identity/Handlers/BatchIdentityUserOperationCommandHandler.cs index 31f4ddc..04ee470 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Handlers/BatchIdentityUserOperationCommandHandler.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Handlers/BatchIdentityUserOperationCommandHandler.cs @@ -196,6 +196,7 @@ public sealed class BatchIdentityUserOperationCommandHandler( TenantId = user.TenantId, Account = user.Account, DisplayName = user.DisplayName, + Avatar = user.Avatar, Phone = user.Phone, Email = user.Email, Status = user.Status, diff --git a/src/Application/TakeoutSaaS.Application/Identity/Handlers/SearchIdentityUsersQueryHandler.cs b/src/Application/TakeoutSaaS.Application/Identity/Handlers/SearchIdentityUsersQueryHandler.cs index 3a16d80..2b880c3 100644 --- a/src/Application/TakeoutSaaS.Application/Identity/Handlers/SearchIdentityUsersQueryHandler.cs +++ b/src/Application/TakeoutSaaS.Application/Identity/Handlers/SearchIdentityUsersQueryHandler.cs @@ -75,6 +75,7 @@ public sealed class SearchIdentityUsersQueryHandler( TenantId = user.TenantId, Account = user.Account, DisplayName = user.DisplayName, + Avatar = user.Avatar, Phone = user.Phone, Email = user.Email, Status = user.Status, diff --git a/src/Application/TakeoutSaaS.Application/Storage/Services/FileStorageService.cs b/src/Application/TakeoutSaaS.Application/Storage/Services/FileStorageService.cs index a887bf9..17eb087 100644 --- a/src/Application/TakeoutSaaS.Application/Storage/Services/FileStorageService.cs +++ b/src/Application/TakeoutSaaS.Application/Storage/Services/FileStorageService.cs @@ -54,11 +54,11 @@ public sealed class FileStorageService( // 4. 上传到对象存储 var uploadResult = await provider.UploadAsync( - new StorageUploadRequest(objectKey, request.Content, contentType, request.ContentLength, true, expires, metadata), + new StorageUploadRequest(objectKey, request.Content, contentType, request.ContentLength, false, expires, metadata), cancellationToken).ConfigureAwait(false); - // 5. 追加防盗链签名并返回 - var finalUrl = AppendAntiLeechToken(uploadResult.SignedUrl ?? uploadResult.Url, objectKey, expires, security); + // 5. 构造公开访问链接并返回 + var finalUrl = provider.BuildPublicUrl(uploadResult.ObjectKey); logger.LogInformation("文件上传成功:{ObjectKey} ({Size} bytes)", objectKey, request.ContentLength); return new FileUploadResponse