Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var PcJwtHandler = jwtmiddleware.New(jwtmiddleware.Config{ ValidationKeyGetter: func(token *jwt.Token) (interface{}, error) { return []byte(conf.Conf.AppSecret), nil }, SigningMethod: jwt.SigningMethodHS256, ErrorHandler: func(ctx iris.Context, err error) { ctx.StatusCode(iris.StatusUnauthorized) ctx.JSON(map[string]interface{}{ "success": false, "message": "jwt token check error: " + err.Error(), "code": iris.StatusUnauthorized, }) debug.PrintStack() }, })
Functions ¶
func NewJwtToken ¶
func ParseToken ¶
Types ¶
type PcLoginInfo ¶
type PcLoginInfo struct {
// contains filtered or unexported fields
}
func ContextLoginInfo ¶
func ContextLoginInfo(ctx iris.Context) *PcLoginInfo
func (*PcLoginInfo) Uk ¶
func (p *PcLoginInfo) Uk() string
func (*PcLoginInfo) User ¶
func (p *PcLoginInfo) User() *dao.UserModel
Click to show internal directories.
Click to hide internal directories.