Documentation ¶
Overview ¶
* @Author: lisheng * @Date: 2022-10-19 16:21:40 * @LastEditTime: 2022-10-21 16:19:26 * @LastEditors: lisheng * @Description: * @FilePath: /gitee.com/liqiyuworks/jf-go-kit/middleware/jwt.go
* @Author: lisheng * @Date: 2022-10-11 00:12:42 * @LastEditTime: 2022-11-02 11:08:10 * @LastEditors: lisheng * @Description: 通用中间件 * @FilePath: /gitee.com/liqiyuworks/jf-go-kit/middleware/middleware.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cors ¶
func Cors() gin.HandlerFunc
func GenerateToken ¶
GenerateToken 一般在登录之后使用来生成 token 能够返回给前端
func ParseToken ¶
ParseToken 解析请求头中的 token string,转换成被解析后的 jwt.Token
Types ¶
type AuthClaims ¶
type AuthClaims struct { UserId interface{} `json:"userId"` jwt.StandardClaims }
AuthClaims 是 claims struct
Click to show internal directories.
Click to hide internal directories.