Update CommentingViewComponent.cs

pull/5153/head
Halil İbrahim Kalkan 5 years ago
parent a835f9bc27
commit d316752da4

@ -4,6 +4,7 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.UI;
using Volo.Abp.AspNetCore.Mvc.UI.Widgets; using Volo.Abp.AspNetCore.Mvc.UI.Widgets;
using Volo.CmsKit.Public.Comments; using Volo.CmsKit.Public.Comments;
using Volo.CmsKit.Web; using Volo.CmsKit.Web;
@ -19,14 +20,14 @@ namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Commenting
public class CommentingViewComponent : AbpViewComponent public class CommentingViewComponent : AbpViewComponent
{ {
public ICommentPublicAppService CommentPublicAppService { get; } public ICommentPublicAppService CommentPublicAppService { get; }
public AbpMvcOptions AbpMvcOptions { get; } public AbpMvcUiOptions AbpMvcUiOptions { get; }
public CommentingViewComponent( public CommentingViewComponent(
ICommentPublicAppService commentPublicAppService, ICommentPublicAppService commentPublicAppService,
IOptions<AbpMvcOptions> options) IOptions<AbpMvcUiOptions> options)
{ {
CommentPublicAppService = commentPublicAppService; CommentPublicAppService = commentPublicAppService;
Options = options.Value; AbpMvcUiOptions = options.Value;
} }
public virtual async Task<IViewComponentResult> InvokeAsync( public virtual async Task<IViewComponentResult> InvokeAsync(
@ -36,7 +37,7 @@ namespace Volo.CmsKit.Public.Web.Pages.CmsKit.Shared.Components.Commenting
var result = await CommentPublicAppService var result = await CommentPublicAppService
.GetListAsync(entityType, entityId); .GetListAsync(entityType, entityId);
var loginUrl = $"{Options.LoginUrl}?returnUrl={HttpContext.Request.Path.ToString()}&returnUrlHash=#cms-comment_{entityType}_{entityId}"; var loginUrl = $"{AbpMvcUiOptions.LoginUrl}?returnUrl={HttpContext.Request.Path.ToString()}&returnUrlHash=#cms-comment_{entityType}_{entityId}";
var viewModel = new CommentingViewModel var viewModel = new CommentingViewModel
{ {

Loading…
Cancel
Save