Browse Source

feat(oss): 完善本地化资源

pull/398/head
cKey 4 years ago
parent
commit
a5d109f651
  1. 7
      aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/FileAppServiceBase.cs
  2. 4
      aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/PrivateFileAppService.cs
  3. 31
      aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/Localization/Resources/en.json
  4. 31
      aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/Localization/Resources/zh-Hans.json
  5. 1
      aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/PrivateFilesController.cs
  6. 1
      aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/PublicFilesController.cs

7
aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/FileAppServiceBase.cs

@ -116,7 +116,7 @@ namespace LINGYUN.Abp.OssManagement
await ossContainer.DeleteObjectAsync(
GetCurrentBucket(),
HttpUtility.UrlDecode(input.Name),
GetCurrentPath(HttpUtility.UrlDecode(input.Path)));
GetCurrentPath(input.Path));
}
protected virtual string GetCurrentBucket()
@ -126,6 +126,11 @@ namespace LINGYUN.Abp.OssManagement
protected virtual string GetCurrentPath(string path)
{
if (path.IsNullOrWhiteSpace())
{
return "";
}
path = HttpUtility.UrlDecode(path);
path = path.RemovePreFix(".").RemovePreFix("/");
return path;
}

4
aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Application/LINGYUN/Abp/OssManagement/PrivateFileAppService.cs

@ -181,6 +181,10 @@ namespace LINGYUN.Abp.OssManagement
{
path = base.GetCurrentPath(path);
var userId = CurrentUser.GetId().ToString("N");
if (path.IsNullOrWhiteSpace())
{
return userId;
}
return path.StartsWith(userId) ? path : $"{userId}/{path}";
}
}

31
aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/Localization/Resources/en.json

@ -58,6 +58,35 @@
"Upload:Error": "Error",
"Upload:Pause": "Pause",
"Upload:Resume": "Resume",
"Upload:Cancel": "Cancel"
"Upload:Cancel": "Cancel",
"Cloud": "Cloud",
"MyCloud": "My Cloud",
"MyDocument": "My Document",
"PublicDocument": "Public Document",
"MyShare": "My Share",
"FileList": "Files",
"Share": "Share",
"Containers": "Containers",
"Containers:Create": "Create Container",
"Containers:Select": "Select Container",
"DisplayName:CreationDate": "Creation Date",
"DisplayName:FileType": "File Type",
"DisplayName:Folder": "FileType",
"DisplayName:LastModifiedDate": "Modified Date",
"DisplayName:Name": "Name",
"DisplayName:Path": "Path",
"DisplayName:Url": "Url",
"DisplayName:ExpirationTime": "Expiration Time",
"DisplayName:AccessCount": "Access Count",
"DisplayName:MaxAccessCount": "Max Access Count",
"DisplayName:AccessRoles": "Access Roles",
"DisplayName:AccessUsers": "Access Users",
"DisplayName:Size": "Size",
"DisplayName:Standard": "Standard",
"Objects:CreateFolder": "Create Folder",
"Objects:Download": "Download",
"Objects:FileSystem": "File System",
"Objects:Preview": "Preview",
"Objects:Root": "Root"
}
}

31
aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Domain.Shared/LINGYUN/Abp/OssManagement/Localization/Resources/zh-Hans.json

@ -58,6 +58,35 @@
"Upload:Error": "错误",
"Upload:Pause": "暂停",
"Upload:Resume": "重传",
"Upload:Cancel": "取消"
"Upload:Cancel": "取消",
"Cloud": "云空间",
"MyCloud": "我的云空间",
"MyDocument": "我的文档",
"PublicDocument": "公共文档",
"MyShare": "我的分享",
"FileList": "文件列表",
"Share": "分享",
"Containers": "容器",
"Containers:Create": "创建容器",
"Containers:Select": "选择一个容器",
"DisplayName:CreationDate": "创建日期",
"DisplayName:FileType": "文件类型",
"DisplayName:Folder": "文件夹",
"DisplayName:LastModifiedDate": "修改日期",
"DisplayName:Name": "名称",
"DisplayName:Path": "路径",
"DisplayName:Url": "链接",
"DisplayName:ExpirationTime": "过期时间",
"DisplayName:AccessCount": "访问次数",
"DisplayName:MaxAccessCount": "最大访问次数",
"DisplayName:AccessRoles": "可访问角色",
"DisplayName:AccessUsers": "可访问用户",
"DisplayName:Size": "大小",
"DisplayName:Standard": "标准存储",
"Objects:CreateFolder": "创建文件夹",
"Objects:Download": "下载",
"Objects:FileSystem": "文件管理",
"Objects:Preview": "预览",
"Objects:Root": "根目录"
}
}

1
aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/PrivateFilesController.cs

@ -15,7 +15,6 @@ namespace LINGYUN.Abp.OssManagement
[Area("oss-management")]
[Route("api/files/private")]
[RemoteService(false)]
[ApiExplorerSettings(IgnoreApi = true)]
public class PrivateFilesController : AbpController
{
private readonly IPrivateFileAppService _privateFileAppService;

1
aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi/LINGYUN/Abp/OssManagement/PublicFilesController.cs

@ -15,7 +15,6 @@ namespace LINGYUN.Abp.OssManagement
[Area("oss-management")]
[Route("api/files/public")]
[RemoteService(false)]
[ApiExplorerSettings(IgnoreApi = true)]
public class PublicFilesController : AbpController
{
private readonly IPublicFileAppService _publicFileAppService;

Loading…
Cancel
Save