Documentation ¶
Index ¶
- Constants
- Variables
- func ComparePassword(password string, encryptedPassword string) bool
- func EncryptPassword(password string) string
- func GenerateToken(username string) (error, string)
- func GetDB() *gorm.DB
- func GetUserNameFromToken(tokenStr string) (error, string)
- func GetUuid() *snowflake.Node
- func InitDB(dbInstance *gorm.DB)
- func InitUuid(nodeInstance *snowflake.Node)
- func MatchUrl(urls []string, path string) bool
- func NormalizeErrorMessage(err error) string
- func NormalizeUrl(url string) string
- func RefreshHeadToken(oldToken string) (error, string)
- func StringToInt64(val string, defaults int64) int64
Constants ¶
View Source
const CustomMsgPrefix = "CUSTOM:"
Variables ¶
View Source
var JwtTokenHead string
View Source
var JwtTokenHeaderKey string
Functions ¶
func GetUserNameFromToken ¶
从token中获取登录用户名
func NormalizeUrl ¶
func RefreshHeadToken ¶
当原来的token没过期时是可以刷新的 @param oldToken 带tokenHead的token
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.