Documentation ¶
Index ¶
- Constants
- func GenerateAdminAccessToken(admin *entity.Admin) (tokenStr string, exp int64, expIn int64, err error)
- func GenerateAdminRefreshToken(admin *entity.Admin) (tokenStr string, exp int64, expIn int64, err error)
- func GenerateParamsSign(dataMap map[string]interface{}, privateKey string) (sign string)
- func GeneratePassword(password string) (re string, err error)
- func GenerateUserAccessToken(user *entity.User) (tokenStr string, exp int64, expIn int64, err error)
- func GenerateUserRefreshToken(user *entity.User) (tokenStr string, exp int64, expIn int64, err error)
- func HostUrl(r ...*ghttp.Request) (re string, err error)
- func ValidateEmailCodeIsRight(scenario string, email string, code string) (err error)
- func ValidateParamsSign(dataMap map[string]interface{}, privateKey string) bool
- func ValidatePassword(password, passwordHash string) bool
- type EmailCodeRe
- type ParseAdminTokenRe
- type ParseUserTokenRe
- type ValidateEmailCodeRe
Constants ¶
View Source
const ( ScenarioSignup = "signup" ScenarioFindPassword = "findPassword" )
View Source
const Key string = "zAr92gmhb9fujgsYgk9Wf6trkfxneuaNG"
Key 加密密钥
Variables ¶
This section is empty.
Functions ¶
func GenerateParamsSign ¶
GenerateParamsSign 生成验签sign
func GeneratePassword ¶
GeneratePassword 生成密码
func GenerateUserAccessToken ¶
func GenerateUserAccessToken(user *entity.User) (tokenStr string, exp int64, expIn int64, err error)
GenerateUserAccessToken 生成Token
func ValidateEmailCodeIsRight ¶
ValidateEmailCodeIsRight 校验是否正确 不管什么错,直接返回错
func ValidateParamsSign ¶
ValidateParamsSign 校验sign是否正确
func ValidatePassword ¶
ValidatePassword 校验密码
Types ¶
type EmailCodeRe ¶
func GenerateEmailCode ¶
func GenerateEmailCode(scenario string, email string, ip string) (re *EmailCodeRe, err error)
GenerateEmailCode 生成4位验证码 传入场景不同的场景不同的验证码互不干扰
type ParseAdminTokenRe ¶
func ParseAdminToken ¶
func ParseAdminToken(tokenStr string) (re *ParseAdminTokenRe, err error)
ParseAdminToken 解析管理员Token
type ParseUserTokenRe ¶
func ParseUserToken ¶
func ParseUserToken(tokenStr string) (re *ParseUserTokenRe, err error)
ParseUserToken 解析Token
type ValidateEmailCodeRe ¶
func ValidateEmailCode ¶
func ValidateEmailCode(scenario string, email string, code string) (re *ValidateEmailCodeRe, err error)
ValidateEmailCode 校验验证码
Click to show internal directories.
Click to hide internal directories.