|
|
|
|
@ -2,7 +2,6 @@ using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc.RazorPages;
|
|
|
|
|
using Volo.Abp.Users;
|
|
|
|
|
using Volo.Docs;
|
|
|
|
|
using Volo.Docs.Projects;
|
|
|
|
|
|
|
|
|
|
@ -11,23 +10,16 @@ namespace VoloDocs.Web.Pages
|
|
|
|
|
public class IndexModel : PageModel
|
|
|
|
|
{
|
|
|
|
|
public IReadOnlyList<ProjectDto> Projects { get; set; }
|
|
|
|
|
public string CreateProjectLink { get; set; }
|
|
|
|
|
|
|
|
|
|
private readonly IProjectAppService _projectAppService;
|
|
|
|
|
private readonly ICurrentUser _currentUser;
|
|
|
|
|
|
|
|
|
|
public IndexModel(IProjectAppService projectAppService, ICurrentUser currentUser)
|
|
|
|
|
public IndexModel(IProjectAppService projectAppService)
|
|
|
|
|
{
|
|
|
|
|
_projectAppService = projectAppService;
|
|
|
|
|
_currentUser = currentUser;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async Task<IActionResult> OnGet()
|
|
|
|
|
{
|
|
|
|
|
CreateProjectLink = _currentUser.Id.HasValue
|
|
|
|
|
? "/Docs/Admin/Projects"
|
|
|
|
|
: "/Account/Login?returnUrl=/Docs/Admin/Projects";
|
|
|
|
|
|
|
|
|
|
Projects = (await _projectAppService.GetListAsync()).Items;
|
|
|
|
|
|
|
|
|
|
if (Projects.Count == 1)
|
|
|
|
|
|