mirror of
https://github.com/VaalaCat/frp-panel.git
synced 2026-04-22 23:17:23 +08:00
22 lines
271 B
Go
22 lines
271 B
Go
package common
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/VaalaCat/frp-panel/models"
|
|
)
|
|
|
|
func GetUserInfo(c context.Context) models.UserInfo {
|
|
val := c.Value(UserInfoKey)
|
|
if val == nil {
|
|
return nil
|
|
}
|
|
|
|
u, ok := val.(*models.UserEntity)
|
|
if !ok {
|
|
return nil
|
|
}
|
|
|
|
return u
|
|
}
|