mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-17 16:24:25 +08:00
support set gravatar as user avatar provider
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
package utils
|
||||
|
||||
import "fmt"
|
||||
|
||||
const gravatarUrlFormat = "https://www.gravatar.com/avatar/%s"
|
||||
|
||||
// GetGravatarUrl returns the Gravatar url according to the specified user email address
|
||||
func GetGravatarUrl(email string) string {
|
||||
emailMd5 := MD5EncodeToString([]byte(email))
|
||||
return fmt.Sprintf(gravatarUrlFormat, emailMd5)
|
||||
}
|
||||
Reference in New Issue
Block a user