xtoken

package
v1.0.18 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: MulanPSL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenToken

func GenToken(sessionInfo *SessionInfo) (string, error)

========= 生成Token ============

Types

type SessionInfo

type SessionInfo struct {
	UserId    int64     `json:"user_id"`
	Uuid      string    `json:"uuid"`
	UserName  string    `json:"user_name"`
	LoginTime time.Time `json:"login_time"`
}

====================================================================== * * 功能:加密解密 token * 描述:用于 WEB 接口鉴权 * ======================================================================

func ParseToken

func ParseToken(tokenStr string) (*SessionInfo, error)

============ 解析 token =============

Jump to

Keyboard shortcuts

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