Fixe l'inscription, affiche un avatar par défaut
This commit is contained in:
parent
6bbe89366e
commit
20fdfa5e54
12 changed files with 2074 additions and 54 deletions
|
|
@ -19,9 +19,9 @@ namespace Yavsc.Helpers
|
|||
{
|
||||
var user = dbContext.Users.FirstOrDefault(u => u.Id == userId);
|
||||
if (user==null) return Constants.AnonAvatar;
|
||||
if (user.Avatar==null) return Constants.DefaultAvatar;
|
||||
if (user.Avatar.StartsWith("/"))
|
||||
{
|
||||
// use fmt
|
||||
FileInfo fi = new FileInfo(user.Avatar);
|
||||
var ext = fi.Extension;
|
||||
var avatar = user.Avatar.Substring(0, user.Avatar.Length - ext.Length );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue