2 Star 1 Fork 0

liudaka / artifactory

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
jwt.go 693 Bytes
一键复制 编辑 原始数据 按行查看 历史
geeeekegeeeeke 提交于 2023-11-23 10:12 . create basic struct
package middleware
import (
//"github.com/1Panel-dev/1Panel/backend/app/api/v1/helper"
//"github.com/1Panel-dev/1Panel/backend/constant"
//jwtUtils "github.com/1Panel-dev/1Panel/backend/utils/jwt"
"github.com/gin-gonic/gin"
)
func JwtAuth() gin.HandlerFunc {
/* return func(c *gin.Context) {
token := c.Request.Header.Get(constant.JWTHeaderName)
if token == "" {
c.Next()
return
}
j := jwtUtils.NewJWT()
claims, err := j.ParseToken(token)
if err != nil {
helper.ErrorWithDetail(c, constant.CodeErrUnauthorized, constant.ErrTypeInternalServer, err)
return
}
c.Set("claims", claims)
c.Set("authMethod", constant.AuthMethodJWT)
c.Next()
}*/
return nil
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/daka1004/artifactory.git
git@gitee.com:daka1004/artifactory.git
daka1004
artifactory
artifactory
495e01fd4b9f

搜索帮助

344bd9b3 5694891 D2dac590 5694891