jwtsession

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package jwtsession

@author: xwc1125

Index

Constants

This section is empty.

Variables

View Source
var (
	JwtPayloadKey = "JWT_PAYLOAD"
	UserIDKey     = "identity"
	UserNameKey   = "user_name"
	RoleIDKey     = "role_id"
	RoleKey       = "role_key"
	RoleNameKey   = "role_name"
	DeptIDKey     = "dept_id"
	DeptNameKey   = "dept_name"
	DataScopeKey  = "data_scope_key"
)

Functions

func ExtractClaims

func ExtractClaims(c contextx.Context) jwtauth.MapClaims

ExtractClaims 从request中获取jwtauth.MapClaims

func Get

func Get(c contextx.Context, key string) interface{}

Get 从jwt的claims中获取指定key的值

func GetDeptId

func GetDeptId(c contextx.Context) int

GetDeptId 获取部门ID

func GetDeptName

func GetDeptName(c contextx.Context) string

GetDeptName 获取部门名称

func GetRoleId

func GetRoleId(c contextx.Context) int

GetRoleId 获取roleId

func GetRoleKey

func GetRoleKey(c contextx.Context) string

GetRoleKey 获取角色

func GetRoleName

func GetRoleName(c contextx.Context) string

GetRoleName 获取角色名称

func GetUserId

func GetUserId(c contextx.Context) int

GetUserId 获取userId

func GetUserIdStr

func GetUserIdStr(c contextx.Context) string

GetUserIdStr 获取userId字符串

func GetUserName

func GetUserName(c contextx.Context) string

GetUserName 获取userName

Types

This section is empty.

Jump to

Keyboard shortcuts

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