mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-17 08:14:25 +08:00
supports local file system object storage and use it as the default avatar provider
This commit is contained in:
@@ -7,6 +7,15 @@ import (
|
||||
|
||||
const gravatarUrlFormat = "https://www.gravatar.com/avatar/%s"
|
||||
|
||||
// GetInternalAvatarUrl returns the internal avatar url
|
||||
func GetInternalAvatarUrl(uid int64, avatarFileExtesion string, webRootUrl string) string {
|
||||
if avatarFileExtesion == "" {
|
||||
return ""
|
||||
}
|
||||
|
||||
return fmt.Sprintf("%savatar/%d.%s", webRootUrl, uid, avatarFileExtesion)
|
||||
}
|
||||
|
||||
// GetGravatarUrl returns the Gravatar url according to the specified user email address
|
||||
func GetGravatarUrl(email string) string {
|
||||
email = strings.TrimSpace(email)
|
||||
|
||||
Reference in New Issue
Block a user