model

package
v0.0.0-...-5a7003e Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2019 License: LGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserPostSuperAdminCode = "2" //超级管理员
	UserPostAdminCode      = "1" //管理员
	UserPostGroupCode      = "0" //普通账号
)

Variables

This section is empty.

Functions

func IsAdmin

func IsAdmin(roles []VSysUserRole) bool

是否为超级管理员

func IsSuperAdmin

func IsSuperAdmin(roles []VSysUserRole) bool

是否为超级管理员

Types

type SysMenuTree

type SysMenuTree struct {
	VSysRoleMenu
	Children []SysMenuTree
}

菜单树

func GetSysMenuTree

func GetSysMenuTree(menus []VSysRoleMenu, parentId string) []SysMenuTree

获取树形菜单

type SysToken

type SysToken struct {
	Token       string //token
	TokenExpire int64  //token过期时间戳
}

token struct

type SysUserLoginInfo

type SysUserLoginInfo struct {
	ID                string               //ID
	Name              string               //账号名称
	Sex               string               //性别
	CompanyId         string               //公司ID
	OfficeId          string               //组织ID
	OfficeParentId    string               //组织关系
	OfficeRelationIds string               //组织关系
	UserType          string               //账号类型
	SysRoles          []VSysUserRole       //角色,支持多角色
	SysMenu           []VSysRoleMenu       //菜单
	SysMenuBtns       []VSysRoleMenuBtn    //菜单按钮权限
	IsSuperAdmin      bool                 //是否为超级管理员
	IsAdmin           bool                 //是否管理员
	PathAuth          map[string]time.Time //url已通过的鉴权
}

后台系统登陆

func GetLoginInfo

func GetLoginInfo(vSysUser VSysUser, roles []VSysUserRole, menus []VSysRoleMenu, menuBtns []VSysRoleMenuBtn) SysUserLoginInfo

登录信息

func (SysUserLoginInfo) GetLoginToken

func (info SysUserLoginInfo) GetLoginToken() *SysUserLoginToken

登录token struct

type SysUserLoginToken

type SysUserLoginToken struct {
	ID                 string //ID
	Unix               int64  //时间戳
	jwt.StandardClaims        //jwt
}

login token struct

type VSysRoleMenu

type VSysRoleMenu struct {
	SysMenu
	SysRoleId string `gorm:"column:sys_role_id" json:"sys_role_id"`
}

func (*VSysRoleMenu) TableName

func (s *VSysRoleMenu) TableName() string

type VSysRoleMenuBtn

type VSysRoleMenuBtn struct {
	SysMenuBtn
	SysRoleId string `gorm:"column:sys_role_id" json:"sys_role_id"`
}

func (*VSysRoleMenuBtn) TableName

func (s *VSysRoleMenuBtn) TableName() string

type VSysUser

type VSysUser struct {
	SysUser
	SysCompanyId      string `gorm:"column:sys_company_id" json:"sys_company_id"`
	OfficeRelationIds string `gorm:"column:office_relation_ids" json:"office_relation_ids"`
	OfficeParentId    string `gorm:"column:office_parent_id" json:"office_parent_id"`
}

func (*VSysUser) TableName

func (s *VSysUser) TableName() string

type VSysUserRole

type VSysUserRole struct {
	SysRole
	SysUserId string `gorm:"column:sys_user_id" json:"sys_user_id"`
}

func (*VSysUserRole) TableName

func (s *VSysUserRole) TableName() string

Jump to

Keyboard shortcuts

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