service

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const TokenExpireDuration = 1 * time.Hour

过期时间, 默认1小时

Variables

View Source
var Secret = "4udLpfC0oebtbdxjYOC1O99ZvZ9cz888OyUFwNLeKilDySduFMrDl7ShGTisbEWC"

私钥

全局变量

Functions

func AddAdminUserOplog

func AddAdminUserOplog(c *gin.Context, msg string, module_id int) int

写入管理员操作日志

func AddAgentOplog

func AddAgentOplog(c *gin.Context, msg string, module_id int) int

写入代理用户操作日志

func GenToken

func GenToken(uid string) string

生成token

func GetCaptcha

func GetCaptcha() (int, string, string)

获取图片验证码

Types

type AuthClaim

type AuthClaim struct {
	UID string `json:"uid"`
	jwt.StandardClaims
}

func Parse

func Parse(tokenString string) (auth AuthClaim, Valid bool)

解析token

Jump to

Keyboard shortcuts

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