users

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RegPhone   = "phone"   //手机号 (企业版)
	RegWxOpen  = "wxOpen"  //微信开放平台登录(企业版)
	RegWxIn    = "wxIn"    //微信内登录(企业版)
	RegWxMiniP = "wxMiniP" //微信小程序(企业版)
	RegPwd     = "pwd"     //账号密码注册
)

phone 手机号 wxOpen 微信开放平台 wxIn 微信内 wxMiniP 微信小程序 pwd 账号密码

Variables

This section is empty.

Functions

func CreateToken

func CreateToken(secretKey string, claims jwt.Claims) (string, error)

创建一个token

func GetLoginJwtToken added in v0.5.1

func GetLoginJwtToken(secretKey string, iat, seconds, userID, role, isAllData int64) (string, error)

func ParseToken

func ParseToken(claim jwt.Claims, tokenString string, secretKey string) error

解析 token

func RefreshLoginToken added in v0.5.1

func RefreshLoginToken(tokenString string, secretKey string, AccessExpire int64) (string, error)

更新token

Types

type LoginClaims added in v0.5.1

type LoginClaims struct {
	UserID    int64 `json:",string"`
	Role      int64
	IsAllData int64
	jwt.StandardClaims
}

Custom claims structure

type UserInfoType

type UserInfoType uint8
const (
	Uid        UserInfoType = iota //用户UID
	InviterUid                     //邀请人用户id
	UserName                       //用户登录名
	GroupId                        //用户组id
	Email                          //邮箱
	Phone                          //手机号
	Wechat                         //微信
	InfoMax                        //结束
	AuthId                         //权限id
)

func GetLoginNameType

func GetLoginNameType(userName string) UserInfoType

type UserStatus

type UserStatus = int64
const (
	NotRegisterStatus UserStatus = iota //未注册完成状态只注册了第一步
	NormalStatus                        //正常状态
)

Jump to

Keyboard shortcuts

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