Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 49b2401

Browse files
committed
收入我的专栏:没有封面使用头像
1 parent ccabc46 commit 49b2401

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/logic/subject.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,10 @@ func (self SubjectLogic) genSubjectMapSlice(subject *model.Subject, subjectMapSl
434434
}
435435

436436
cover := subject.Cover
437-
if !strings.HasPrefix(cover, "http") {
437+
if cover == "" {
438+
user := usersMap[subject.Uid]
439+
cover = util.Gravatar(user.Avatar, user.Email, 48, true)
440+
} else if !strings.HasPrefix(cover, "http") {
438441
cdnDomain := global.App.CanonicalCDN(true)
439442
cover = cdnDomain + subject.Cover
440443
}

0 commit comments

Comments
 (0)