utils

package
v0.0.0-...-c335ce4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 13, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JWTsecret = []byte("TikTokABAB")

JWTsecret 秘钥

Functions

func GenerateToken

func GenerateToken(userId int) (string, error)

GenerateToken 创建token

func MD5

func MD5(v string) string

MD5 MD5加密算法 v 是要加密的值

func RemoveRepeatedElement

func RemoveRepeatedElement(s []int) []int

通过map键的唯一性去重

Types

type Claims

type Claims struct {
	UserId int `json:"user_id"`
	jwt.StandardClaims
}

func ParseToken

func ParseToken(token string) (*Claims, error)

ParseToken 解析token

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL