Skip to content

Commit fc68dda

Browse files
committed
1 parent 6a9d27d commit fc68dda

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

src/Taskever/Taskever.Application/Users/Dto/UserDtosMapper.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ public static void Map()
1313
configuration => configuration.ResolveUsing(
1414
user => user.ProfileImage == null
1515
//TODO: How to implement this?
16-
? "/Abp/Framework/images/user.png"
17-
: "/ProfileImages/" + user.ProfileImage
16+
? ""
17+
: "ProfileImages/" + user.ProfileImage
1818
)
1919
).ReverseMap();
2020

src/Taskever/Taskever.Web.Mvc/App/Main/views/friends.cshtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<ul class="list-group friend-list-detailed" data-bind="foreach: friendships">
1111
<!-- ko if: status() == 2 -->
1212
<li class="list-group-item">
13-
<img data-bind="attr: { src: friend.profileImage() }" />
13+
<img data-bind="attr: { src: abp.toAbsAppPath(friend.profileImage()) }" />
1414
<div class="row">
1515
<div class="col-xs-8">
1616
<div class="user-info">
@@ -39,7 +39,7 @@
3939
<ul class="list-group friend-list-detailed" data-bind="foreach: friendships">
4040
<!-- ko if: status() == 1 -->
4141
<li class="list-group-item">
42-
<img data-bind="attr: { src: friend.profileImage() }" />
42+
<img data-bind="attr: { src: abp.toAbsAppPath(friend.profileImage()) }" />
4343
<div class="user-info">
4444
<div>
4545
<a data-bind="attr: { href: '#user/' + friend.id() }">
@@ -61,7 +61,7 @@
6161
<ul class="list-group friend-list-detailed" data-bind="foreach: friendships">
6262
<!-- ko if: status() == 0 -->
6363
<li class="list-group-item">
64-
<img data-bind="attr: { src: friend.profileImage() }" />
64+
<img data-bind="attr: { src: abp.toAbsAppPath(friend.profileImage()) }" />
6565
<div class="user-info">
6666
<div>
6767
<a data-bind="attr: { href: '#user/' + friend.id() }">

src/Taskever/Taskever.Web.Mvc/App/Main/views/user.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<section>
22
<div class="panel panel-default" style="margin-bottom: 10px; position: relative; height: 70px">
3-
<img data-bind="attr: { src: user.profileImage() }" style="width: 64px; height: 64px; position: absolute; top: 2px; left: 2px;" alt="" />
3+
<img data-bind="attr: { src: abp.toAbsAppPath(user.profileImage()) }" style="width: 64px; height: 64px; position: absolute; top: 2px; left: 2px;" alt="" />
44
<div style="margin-left: 75px; margin-top: 36px">
55
<h4 data-bind="text: user.name() + ' ' + user.surname()"></h4>
66
</div>

src/Taskever/Taskever.Web.Mvc/Controllers/AccountController.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,20 @@ public AccountController(ITaskeverUserAppService userAppService, AbpUserManager
3939
_userManager = userManager;
4040
}
4141

42-
public virtual ActionResult Login(string returnUrl = "/", string loginMessage = "")
42+
public virtual ActionResult Login(string returnUrl = "", string loginMessage = "")
4343
{
44+
if (string.IsNullOrWhiteSpace(returnUrl))
45+
{
46+
returnUrl = Request.ApplicationPath;
47+
}
48+
4449
ViewBag.ReturnUrl = returnUrl;
4550
ViewBag.LoginMessage = loginMessage;
4651
return View();
4752
}
4853

4954
[HttpPost]
50-
public virtual async Task<JsonResult> Login(LoginModel loginModel, string returnUrl = "/")
55+
public virtual async Task<JsonResult> Login(LoginModel loginModel, string returnUrl = "")
5156
{
5257
if (!ModelState.IsValid)
5358
{
@@ -62,6 +67,11 @@ public virtual async Task<JsonResult> Login(LoginModel loginModel, string return
6267

6368
await SignInAsync(user, loginModel.RememberMe);
6469

70+
if (string.IsNullOrWhiteSpace(returnUrl))
71+
{
72+
returnUrl = Request.ApplicationPath;
73+
}
74+
6575
return Json(new AbpMvcAjaxResponse { TargetUrl = returnUrl });
6676
}
6777

0 commit comments

Comments
 (0)