Skip to content

Commit

Permalink
fixed avatar url bug
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Sep 17, 2012
1 parent 6a12463 commit 2ccf49a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions models/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ UserSchema.virtual('avatar_url').get(function () {
var avatar_url = this.profile_image_url || this.avatar;
if (!avatar_url) {
avatar_url = config.site_static_host + '/images/user_icon&48.png';
} else {
// url不会出现空格,解决之前被@leizongmin 黑的bug
avatar_url = avatar_url.split(' ', 1)[0];
}
return avatar_url;
});
Expand Down

0 comments on commit 2ccf49a

Please sign in to comment.