|
|
|
@ -17,10 +17,21 @@ namespace Volo.Docs.Pages.Documents |
|
|
|
_projectAppService = projectAppService; |
|
|
|
} |
|
|
|
|
|
|
|
public async Task<IActionResult> OnGet() |
|
|
|
public async Task<IActionResult> OnGetAsync() |
|
|
|
{ |
|
|
|
var listResult = await _projectAppService.GetListAsync(); |
|
|
|
|
|
|
|
if (listResult.Items.Count == 1) |
|
|
|
{ |
|
|
|
return RedirectToPage("./Project/Index", new |
|
|
|
{ |
|
|
|
projectName = listResult.Items[0].ShortName, |
|
|
|
version = DocsAppConsts.Latest, |
|
|
|
languageCode = await _projectAppService.GetDefaultLanguageCode(listResult.Items[0].ShortName), |
|
|
|
documentName = listResult.Items[0].DefaultDocumentName |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
Projects = listResult.Items; |
|
|
|
|
|
|
|
return Page(); |
|
|
|
|