Documentation ¶
Index ¶
- Variables
- func Cors() gin.HandlerFunc
- func GetCurrentMember(ctx *gin.Context) (string, *dto.MemberDto)
- func GetCurrentUser(ctx *gin.Context) (string, *dto.UserDto)
- func JWT() gin.HandlerFunc
- func SaveServices(service []interface{}) gin.HandlerFunc
- func TokenExpHandler(w http.ResponseWriter, r *http.Request) (exp time.Duration, err error)
- func UserAuthorizeHandler(w http.ResponseWriter, r *http.Request) (userID string, err error)
- func ValidPasswordHandler(username, password string) (userID string, err error)
- type ClientStore
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Services map[string]interface{} AuthServer *server.Server )
Functions ¶
func GetCurrentMember ¶
GetCurrentMember: 获取当前请求登陆的用户(web)
func GetCurrentUser ¶
GetCurrentUser: 获取当前请求登陆的用户(admin)
func SaveServices ¶
func SaveServices(service []interface{}) gin.HandlerFunc
SaveServices : 将服务实例存放到gin中
func TokenExpHandler ¶
TokenExpHandler: 令牌过期时间 默认两天
func UserAuthorizeHandler ¶
UserAuthorizeHandler: 授权码式授权-用户授权环节-从请求中解析出userID
func ValidPasswordHandler ¶
ValidPasswordHandler: 密码式授权-校验密码
Types ¶
type ClientStore ¶
type ClientStore struct { }
Click to show internal directories.
Click to hide internal directories.