util

package
v0.0.0-...-8edd1ee Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const TokenExpireTime = 86400 * 7

用户token默认过期时间,单位秒

Variables

This section is empty.

Functions

func FormatTokenUserKey

func FormatTokenUserKey(token string) string

token找uid

func FormatUserTokenKey

func FormatUserTokenKey(uid uint) string

uid找token

func GenToken

func GenToken() string

生成token

Types

type UserToken

type UserToken struct {
	Username   string `json:"username"`
	UID        uint   `json:"uid"` // 用户id
	Token      string `json:"token"`
	ExpireTime int64  `json:"expire_time"` // 过期时间戳
}

用户token信息

Jump to

Keyboard shortcuts

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