|
|
|
@ -70,6 +70,11 @@ namespace Volo.Docs.Pages.Documents.Project |
|
|
|
await SetVersionAsync(); |
|
|
|
await SetLanguageList(); |
|
|
|
|
|
|
|
if (IsDefaultDocument()) |
|
|
|
{ |
|
|
|
return RedirectToDefaultDocument(); |
|
|
|
} |
|
|
|
|
|
|
|
if (!CheckLanguage()) |
|
|
|
{ |
|
|
|
return RedirectToDefaultLanguage(); |
|
|
|
@ -83,6 +88,11 @@ namespace Volo.Docs.Pages.Documents.Project |
|
|
|
return Page(); |
|
|
|
} |
|
|
|
|
|
|
|
private bool IsDefaultDocument() |
|
|
|
{ |
|
|
|
return DocumentName == Project.DefaultDocumentName; |
|
|
|
} |
|
|
|
|
|
|
|
private async Task SetProjectAsync() |
|
|
|
{ |
|
|
|
Project = await _projectAppService.GetAsync(ProjectName); |
|
|
|
@ -114,6 +124,17 @@ namespace Volo.Docs.Pages.Documents.Project |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
private IActionResult RedirectToDefaultDocument() |
|
|
|
{ |
|
|
|
return RedirectToPage(new |
|
|
|
{ |
|
|
|
projectName = ProjectName, |
|
|
|
version = Version, |
|
|
|
documentName = "", |
|
|
|
languageCode = DefaultLanguageCode |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
private async Task SetProjectsAsync() |
|
|
|
{ |
|
|
|
var projects = await _projectAppService.GetListAsync(); |
|
|
|
@ -228,16 +249,11 @@ namespace Volo.Docs.Pages.Documents.Project |
|
|
|
|
|
|
|
private async Task SetDocumentAsync() |
|
|
|
{ |
|
|
|
if (DocumentName.IsNullOrWhiteSpace()) |
|
|
|
{ |
|
|
|
DocumentName = Project.DefaultDocumentName; |
|
|
|
} |
|
|
|
|
|
|
|
DocumentNameWithExtension = DocumentName + "." + Project.Format; |
|
|
|
|
|
|
|
try |
|
|
|
{ |
|
|
|
if (DocumentNameWithExtension.IsNullOrWhiteSpace()) |
|
|
|
if (DocumentName.IsNullOrWhiteSpace()) |
|
|
|
{ |
|
|
|
Document = await _documentAppService.GetDefaultAsync( |
|
|
|
new GetDefaultDocumentInput |
|
|
|
|