auth

package
v0.0.0-...-971e649 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RefreshTokenExpired = 24 * time.Hour * 3
	AccessTokenExpired  = 2 * time.Hour
)

Variables

This section is empty.

Functions

func New

Types

type Auth

type Auth struct {
	*apputils.ServerUtils
}

func (*Auth) InitGlobalRoute

func (a *Auth) InitGlobalRoute(g *gin.RouterGroup)

func (*Auth) InitRoute

func (a *Auth) InitRoute(g *gin.RouterGroup)

func (*Auth) IsValidSession

func (s *Auth) IsValidSession(c *gin.Context)

是否登录 godoc @Summary 是否登录 @Schemes @Description 是否登录 @Tags auth @Accept json @Produce json @Param token header string true "登录返回的Token" @Success 200 {object} model.CommonResponse[model.GetUserResponse] @Failure 400 {object} model.CommonResponse[any] @Router /isvalid [get]

func (*Auth) UserLogin

func (s *Auth) UserLogin(c *gin.Context)

登录 godoc @Summary 登录 @Schemes @Description 登录 @Tags auth @Accept json @Produce json @Param password query string true "密码" @Param userid query int false "用户ID" @Param name query string false "用户名" @Param email query string false "用户邮箱" @Success 200 {object} model.CommonResponse[model.TokenResponse] @Failure 400 {object} model.CommonResponse[any] @Router /login [post]

func (*Auth) UserLoginRefresh

func (s *Auth) UserLoginRefresh(c *gin.Context)

刷新登录令牌 godoc @Summary 刷新登录令牌 @Schemes @Description 刷新登录令牌 @Tags auth @Accept json @Produce json @Param refreshToken header int false "用户Refresh Token" @Success 200 {object} model.CommonResponse[model.TokenResponse] @Failure 400 {object} model.CommonResponse[any] @Router /refresh [post]

Jump to

Keyboard shortcuts

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