Documentation
¶
Index ¶
- Variables
- func CaptchaVerify(c *gin.Context, code string) bool
- func CreateDir(dirName string) bool
- func DirExistOrNot(fileAddr string) bool
- func GenerateEmailToken(userID, Operation uint, email, password string) (string, error)
- func GenerateToken(id uint, username string, authority int) (string, error)
- func PadPwd(srcByte []byte, blockSize int) []byte
- func UnPadPwd(dst []byte) ([]byte, error)
- func UploadToLocalStatic(file multipart.File, userId uint, Name string, utype UploadType) (filePath string, err error)
- type Claims
- type EmailClaims
- type Encryption
- type UploadType
Constants ¶
This section is empty.
Variables ¶
View Source
var TypeFileName = [...]string{Avatar: "user", ProductImg: "boss"}
Functions ¶
func GenerateEmailToken ¶
GenerateEmailToken 签发邮箱验证Token
func GenerateToken ¶
签发用户Token
func UploadToLocalStatic ¶
Types ¶
type Claims ¶
type EmailClaims ¶
type EmailClaims struct { UserID uint `json:"user_id"` Email string `json:"email"` Password string `json:"password"` OperationType uint `json:"operation_type"` jwt.StandardClaims }
EmailClaims
func ParseEmailToken ¶
func ParseEmailToken(token string) (*EmailClaims, error)
ParseEmailToken 验证邮箱验证token
type Encryption ¶
type Encryption struct {
// contains filtered or unexported fields
}
AES 加密算法
var Encrypt *Encryption
全局加密器
func NewEncryption ¶
func NewEncryption() *Encryption
Click to show internal directories.
Click to hide internal directories.