Skip to content

Commit

Permalink
Merge pull request #48 from TonyZhangshi81/feature/#movie_dev
Browse files Browse the repository at this point in the history
Feature/#movie dev
  • Loading branch information
TonyZhangshi81 authored Dec 27, 2023
2 parents 7f9dcc5 + 17d74c2 commit be2d438
Show file tree
Hide file tree
Showing 20 changed files with 120 additions and 102 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -256,4 +256,5 @@ ModelManifest.xml
!/tools/nginx-1.24.0/ssl/.gitkeep

/tools/nginx-1.24.0/temp/*
!/tools/nginx-1.24.0/temp/.gitkeep
!/tools/nginx-1.24.0/temp/.gitkeep
/src/tye-app/.tye/process_store
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ public AccountController(IMediator mediator, ILogger<AccountController> logger,
[HttpGet]
[AllowAnonymous]
[LogonFilter]
public ActionResult Login(string returnUrl)
public ActionResult Login(string transfer)
{
if (base.User.Identity.IsAuthenticated)
{
return base.RedirectToAction("Index", "Mine");
}
base.ViewBag.ReturnUrl = returnUrl;
base.ViewBag.Transfer = transfer;
return base.View();
}

Expand All @@ -65,7 +65,7 @@ public ActionResult Login(string returnUrl)
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Login(LoginViewModel model, string returnurl)
public async Task<IActionResult> Login(LoginViewModel model, string transfer)
{
try
{
Expand All @@ -89,7 +89,7 @@ public async Task<IActionResult> Login(LoginViewModel model, string returnurl)
{
return base.RedirectToAction("Index", "Movie", new { Area = "Manage" });
}
return this.RedirectToLocal(returnurl);
return this.RedirectToLocal(transfer);

case Commands.Account.SignInStatus.UndefinedAccount:
base.ModelState.AddModelError("", "用户名不存在。");
Expand Down Expand Up @@ -144,7 +144,7 @@ private async Task SetClaimsIdentity(AccountNameVO account, UserIdVO userId, IsA
//
// POST: /Account/SignOut/
[HttpGet]
public async Task<IActionResult> SignOut(string returnUrl)
public async Task<IActionResult> SignOut(string transfer)
{
switch (this._authenticationSettings.Provider)
{
Expand Down Expand Up @@ -174,7 +174,7 @@ public async Task<IActionResult> SignOut(string returnUrl)
consentFeature.WithdrawConsent();
}

return this.RedirectToLocal(returnUrl);
return this.RedirectToLocal(transfer);
}

#endregion
Expand All @@ -200,11 +200,11 @@ public bool GrantCookie()



private ActionResult RedirectToLocal(string returnUrl)
private ActionResult RedirectToLocal(string transfer)
{
if (!base.Url.IsLocalUrl(returnUrl) && !string.IsNullOrEmpty(returnUrl) && !string.IsNullOrWhiteSpace(returnUrl))
if (!string.IsNullOrEmpty(transfer) && !string.IsNullOrWhiteSpace(transfer)) // !base.Url.IsLocalUrl(transfer) &&
{
return base.Redirect(returnUrl);
return base.Redirect(transfer);
}
return base.RedirectToAction("Index", "Home");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ public CommentController(IMediator mediator, ICurrentRequestId currentRequestId)
//
// GET: /Comment/Create/
[Authorize]
public async Task<IActionResult> Create(ContentVO content, MovieIdVO movieId, string returnurl)
public async Task<IActionResult> Create(ContentVO content, MovieIdVO movieId, string transfer)
{
// 创建请求ID
this._currentRequestId.Set(new RequestIdVO(Guid.NewGuid()));

var command = new FilmHouse.Commands.Comment.CreateCommand(content, movieId);
await this._mediator.Send(command);

return RedirectToLocal(returnurl);
return RedirectToLocal(transfer);
}

#endregion
Expand All @@ -51,7 +51,7 @@ public async Task<IActionResult> Create(ContentVO content, MovieIdVO movieId, st
//
// GET: /Comment/Delete/
[Authorize]
public async Task<ActionResult> Delete(CommentIdVO commentId, string returnurl)
public async Task<ActionResult> Delete(CommentIdVO commentId, string transfer)
{
var command = new FilmHouse.Commands.Comment.DeleteCommand(commentId);
var result = await this._mediator.Send(command);
Expand All @@ -60,19 +60,19 @@ public async Task<ActionResult> Delete(CommentIdVO commentId, string returnurl)
{
return RedirectToAction("NotFound", "Error");
}
return RedirectToLocal(returnurl);
return RedirectToLocal(transfer);
}

#endregion




private ActionResult RedirectToLocal(string returnurl)
private ActionResult RedirectToLocal(string transfer)
{
if (!Url.IsLocalUrl(returnurl) && !string.IsNullOrEmpty(returnurl) && !string.IsNullOrWhiteSpace(returnurl))
if (!string.IsNullOrEmpty(transfer) && !string.IsNullOrWhiteSpace(transfer)) // !Url.IsLocalUrl(transfer) &&
{
return Redirect(returnurl);
return Redirect(transfer);
}
return RedirectToAction("Index", "Home");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public MarkController(IMediator mediator, IHttpContextAccessor httpContextAccess
//
// GET: /Mark/Create/
[Authorize]
public async Task<IActionResult> Create(Guid target, MarkTypeVO type, string returnurl)
public async Task<IActionResult> Create(Guid target, MarkTypeVO type, string transfer)
{
if (!await this.CheckTargetIdIsExist(target, type))
{
Expand All @@ -58,7 +58,7 @@ public async Task<IActionResult> Create(Guid target, MarkTypeVO type, string ret
await this._mediator.Send(command);
}

return Redirect(returnurl);
return Redirect(transfer);
}

private async Task<bool> CheckTargetIdIsExist(Guid targetId, MarkTypeVO markType)
Expand Down Expand Up @@ -97,7 +97,7 @@ private async Task<bool> CheckTargetIdIsExist(Guid targetId, MarkTypeVO markType
//
// GET: /Mark/Cancel/
[Authorize]
public async Task<IActionResult> Cancel(Guid target, MarkTypeVO type, string returnurl)
public async Task<IActionResult> Cancel(Guid target, MarkTypeVO type, string transfer)
{
if (!await this.CheckTargetIdIsExist(target, type))
{
Expand All @@ -117,7 +117,7 @@ public async Task<IActionResult> Cancel(Guid target, MarkTypeVO type, string ret
await this._mediator.Send(command);
}

return Redirect(returnurl);
return Redirect(transfer);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ public MovieActionBarViewComponent(ILogger<MovieActionBarViewComponent> logger)
///
/// </summary>
/// <param name="viewModel"></param>
/// <param name="returnUrl"></param>
/// <param name="transfer"></param>
/// <returns></returns>
public IViewComponentResult Invoke(MovieActionBarViewModel viewModel, string returnUrl)
public IViewComponentResult Invoke(MovieActionBarViewModel viewModel, string transfer)
{
try
{
ViewBag.ReturnUrl = returnUrl;
ViewBag.Transfer = transfer;
return View("/Views/Components/MovieActionBar/Index.cshtml", viewModel);
}
catch (Exception e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ public MovieCommentsHurdleViewComponent(ILogger<MovieCommentsHurdleViewComponent
///
/// </summary>
/// <param name="comments"></param>
/// <param name="returnUrl"></param>
/// <param name="transfer"></param>
/// <param name="isFinish"></param>
/// <returns></returns>
public IViewComponentResult Invoke(List<CommentDiscViewModel> comments, string returnUrl, bool isFinish)
public IViewComponentResult Invoke(List<CommentDiscViewModel> comments, string transfer, bool isFinish)
{
try
{
ViewBag.ReturnUrl = returnUrl;
ViewBag.Transfer = transfer;
ViewBag.IsFinish = isFinish;
return View("/Views/Components/MovieCommentsHurdle/Index.cshtml", comments);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ public MovieResourcesHurdleViewComponent(ILogger<MovieResourcesHurdleViewCompone
///
/// </summary>
/// <param name="movieResources"></param>
/// <param name="returnUrl"></param>
/// <param name="transfer"></param>
/// <returns></returns>
public IViewComponentResult Invoke(MovieResourcesHurdleViewModel movieResources, string returnUrl)
public IViewComponentResult Invoke(MovieResourcesHurdleViewModel movieResources, string transfer)
{
try
{
ViewBag.ReturnUrl = returnUrl;
ViewBag.Transfer = transfer;
return View("/Views/Components/MovieResourcesHurdle/Index.cshtml", movieResources);
}
catch (Exception e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ public MovieShortReviewHurdleViewComponent(ILogger<MovieShortReviewHurdleViewCom
///
/// </summary>
/// <param name="viewModel"></param>
/// <param name="returnUrl"></param>
/// <param name="transfer"></param>
/// <returns></returns>
public IViewComponentResult Invoke(MovieShortReviewHurdleViewModel viewModel, string returnUrl)
public IViewComponentResult Invoke(MovieShortReviewHurdleViewModel viewModel, string transfer)
{
try
{
ViewBag.ReturnUrl = returnUrl;
ViewBag.Transfer = transfer;
return View("/Views/Components/MovieShortReviewHurdle/Index.cshtml", viewModel);
}
catch (Exception e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
var name = settingProvider.GetValue("WebSiteSettings:Name");
}

<form asp-action="Login" asp-controller="Account" asp-route-returnUrl="@ViewBag.ReturnUrl" method="post" class="form-horizontal" role="form">
<form asp-action="Login" asp-controller="Account" asp-route-returnUrl="@ViewBag.Transfer" method="post" class="form-horizontal" role="form">

@Html.AntiForgeryToken()
<div class="panel panel-body center-horizon panel-login" style="margin-top:20px; padding:30px 50px 20px 50px;">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,41 +2,41 @@
@model MovieActionBarViewModel

@{
var fullUrl = ViewBag.ReturnUrl;
var transfer = ViewBag.Transfer;

@if (!Model.IsPlan)
{
<a class="btn btn-mark" title="想看" href="/Mark/[email protected]&type=1&returnurl=@fullUrl">
<a class="btn btn-mark" title="想看" href="/Mark/[email protected]&type=1&transfer=@transfer">
<span class="fa fa-clock-o" aria-hidden="true"></span> 想看
</a>
}
else
{
<a class="btn btn-mark-inverse" title="取消想看" href="/Mark/[email protected]&type=1&returnurl=@fullUrl">
<a class="btn btn-mark-inverse" title="取消想看" href="/Mark/[email protected]&type=1&transfer=@transfer">
<span class="fa fa-clock-o" aria-hidden="true"></span> 想看
</a>
}
@if (!Model.IsFinish)
{
<a class="btn btn-mark" title="看过" href="/Mark/[email protected]&type=2&returnurl=@fullUrl">
<a class="btn btn-mark" title="看过" href="/Mark/[email protected]&type=2&transfer=@transfer">
<span class="fa fa-check-circle-o" aria-hidden="true"></span> 看过
</a>
}
else
{
<a class="btn btn-mark-inverse" title="取消看过" href="/Mark/[email protected]&type=2&returnurl=@fullUrl">
<a class="btn btn-mark-inverse" title="取消看过" href="/Mark/[email protected]&type=2&transfer=@transfer">
<span class="fa fa-check-circle-o" aria-hidden="true"></span> 看过
</a>
}
@if (!Model.IsFavor)
{
<a class="btn btn-mark" title="喜欢" href="/Mark/[email protected]&type=3&returnurl=@fullUrl">
<a class="btn btn-mark" title="喜欢" href="/Mark/[email protected]&type=3&transfer=@transfer">
<span class="fa fa-heart-o" aria-hidden="true"></span> 喜欢
</a>
}
else
{
<a class="btn btn-mark-inverse" title="取消喜欢" href="/Mark/[email protected]&type=3&returnurl=@fullUrl" aria-hidden="true">
<a class="btn btn-mark-inverse" title="取消喜欢" href="/Mark/[email protected]&type=3&transfer=@transfer" aria-hidden="true">
<span class="fa fa-heart-o"></span> 喜欢
</a>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@model List<CommentDiscViewModel>

@{
var fullUrl = ViewBag.ReturnUrl;
var transfer = ViewBag.Transfer;
var isFinish = ViewBag.IsFinish;

@if (Model.Count == 0)
Expand All @@ -21,7 +21,7 @@
{
<div class="comment-item">
<div class="avatar">
<a class="link-avatar" title="@item.Account" href="/People/[email protected]&returnurl=@fullUrl" target="_self">
<a class="link-avatar" title="@item.Account" href="/People/[email protected]&transfer=@transfer" target="_self">
<img src="~/Content/User/Avatar/@item.UserAvatar" style="width: 54px;height: 54px; border-radius: 27px;">
</a>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@model MovieResourcesHurdleViewModel

@{
var fullUrl = ViewBag.ReturnUrl;
var transfer = ViewBag.Transfer;

@if (Model.Resources.Count == 0)
{
Expand Down Expand Up @@ -41,7 +41,7 @@
@if (item.UserId != null)
{
<td>
<a href="/People/[email protected]&returnurl=@fullUrl" class="link-text" target="_self" title="@item.Account 的主页">@item.Account</a>
<a href="/People/[email protected]&transfer=@transfer" class="link-text" target="_self" title="@item.Account 的主页">@item.Account</a>
</td>
}
else
Expand Down Expand Up @@ -79,7 +79,7 @@
@item.DiscSize
</td>
<td>
<a class="btn btn-xs" title="有用" href="/Resource/[email protected]&returnurl=@fullUrl">
<a class="btn btn-xs" title="有用" href="/Resource/[email protected]&transfer=@transfer">
<span class="fa fa-thumbs-o-up"></span>&nbsp;@item.FavorCount
</a>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@model MovieShortReviewHurdleViewModel;

@{
var fullUrl = ViewBag.ReturnUrl;
var transfer = ViewBag.Transfer;

@*关注度*@
<div class="panel panel-body">
Expand Down Expand Up @@ -40,7 +40,7 @@
else
{
<span>我的短评:@Model.PersonalReview.Content</span>
<a class="link-text font-small" title="删除" href="/Comment/[email protected]&returnurl=@fullUrl">删除</a>
<a class="link-text font-small" title="删除" href="/Comment/[email protected]&transfer=@transfer">删除</a>
}
}
</div>
Expand Down
Loading

0 comments on commit be2d438

Please sign in to comment.