errcode
This commit is contained in:
20
infra/parser.go
Normal file
20
infra/parser.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package infra
|
||||
|
||||
import (
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
type Auth struct {
|
||||
CustomerID int64 // 企业编号
|
||||
CustomerCode string // 企业标识
|
||||
UserID int64 // 用户编号
|
||||
UserIdentity string // 用户标识
|
||||
}
|
||||
|
||||
func ParserCtx(ctx *fiber.Ctx) *Auth {
|
||||
customerID := ctx.Locals("customerID").(int64)
|
||||
customerCode := ctx.Locals("customerCode").(string)
|
||||
userID := ctx.Locals("userID").(int64)
|
||||
userIdentity := ctx.Locals("userIdentity").(string)
|
||||
return &Auth{CustomerID: customerID, CustomerCode: customerCode, UserID: userID, UserIdentity: userIdentity}
|
||||
}
|
||||
Reference in New Issue
Block a user