Skip to content

Commit

Permalink
收入我的专栏:没有封面使用头像
Browse files Browse the repository at this point in the history
  • Loading branch information
polaris1119 committed Feb 25, 2018
1 parent ccabc46 commit 49b2401
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/logic/subject.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,10 @@ func (self SubjectLogic) genSubjectMapSlice(subject *model.Subject, subjectMapSl
}

cover := subject.Cover
if !strings.HasPrefix(cover, "http") {
if cover == "" {
user := usersMap[subject.Uid]
cover = util.Gravatar(user.Avatar, user.Email, 48, true)
} else if !strings.HasPrefix(cover, "http") {
cdnDomain := global.App.CanonicalCDN(true)
cover = cdnDomain + subject.Cover
}
Expand Down

0 comments on commit 49b2401

Please sign in to comment.