UserLogin

package
v5.1.34 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckQrcode

func CheckQrcode(args *ArgsCheckQrcode) (userID int64, err error)

CheckQrcode 验证扫码行为

func FinishQrcode

func FinishQrcode(args *ArgsFinishQrcode) (err error)

func Init

func Init(appName string)

func LoginAfter

func LoginAfter(c *gin.Context, userInfo *UserCore.FieldsUserType, loginMark string, rememberMe bool, loginFrom string)

LoginAfter 用户登陆成功后标准步骤

func LoginAfter2

func LoginAfter2(c *gin.Context, userInfo *UserCore.FieldsUserType, loginMark string, rememberMe bool, loginFrom string)

LoginAfter2 用户登陆成功后标准步骤 TODO: 未来需要对内部函数做一些整理和优化

func LoginAfterSave

func LoginAfterSave(c *gin.Context, userInfo *UserCore.FieldsUserType, loginMark string, rememberMe bool, loginFrom string)

LoginAfterSave 用户登陆成功后标准步骤 该设计会将数据,存储到列队等待处理

func LoginData

func LoginData(c *gin.Context, userID int64) (userData UserCore.DataUserDataType, orgData []OrgCoreCore.DataGetBindByUserMarge, err error)

LoginData 登陆后数据包

func LoginData2

func LoginData2(userID int64) (userData UserCore.DataUserDataType, orgData []OrgCoreCore.DataGetBindByUserMarge, err error)

LoginData2 登陆后数据包

func Run

func Run()

Types

type ArgsCheckQrcode

type ArgsCheckQrcode struct {
	//ID
	ID int64 `json:"id"`
	//key
	Key string `json:"key"`
}

ArgsCheckQrcode 验证扫码行为参数

type ArgsFinishQrcode

type ArgsFinishQrcode struct {
	//ID
	ID int64 `json:"id"`
	//Key key
	Key string `json:"key"`
	//UserID 用户ID
	UserID int64 `json:"userID"`
}

完成扫码操作

type ArgsGetSave

type ArgsGetSave struct {
	//密钥
	Key string `db:"key" json:"key"`
}

ArgsGetSave 提取数据

type ArgsMakeQrcode

type ArgsMakeQrcode struct {
	//会话ID
	TokenID int64 `json:"tokenID"`
	//系统类型
	SystemMark string `json:"systemMark"`
}

ArgsMakeQrcode 构建扫码的二维码参数

type DataQrcode

type DataQrcode struct {
	//APP前缀
	// xxx_v2_user_login
	Mark string `json:"mark"`
	//ID
	ID int64 `json:"id"`
	//密钥
	// 二维码根据ID\Key混合计算,APP扫码后识别匹配
	// 二维码包含前缀设计: user_login、APP名称
	Key string `json:"key"`
}

DataQrcode 二维码结构设计

func MakeQrcode

func MakeQrcode(args *ArgsMakeQrcode) (dataQrcode DataQrcode, err error)

MakeQrcode 构建扫码的二维码 会话新增新的二维码后,将自动删除不是同一个系统下旧的二维码

func (*DataQrcode) GetData

func (t *DataQrcode) GetData(jsonData string) error

GetData 转化JSON为DataQrcode

func (*DataQrcode) GetJSON

func (t *DataQrcode) GetJSON() (string, error)

GetJSON 转化DataQrcode为JSON字符串

type FieldsQrcode

type FieldsQrcode struct {
	//ID
	ID int64 `db:"id" json:"id"`
	//创建时间
	CreateAt time.Time `db:"create_at" json:"createAt"`
	//过期时间
	ExpireAt time.Time `db:"expire_at" json:"expireAt"`
	//会话ID
	TokenID int64 `db:"token_id" json:"tokenID"`
	//来源系统
	SystemMark string `db:"system_mark" json:"systemMark"`
	//所属用户
	UserID int64 `db:"user_id" json:"userID"`
	//密钥
	// 二维码根据ID\Key混合计算,APP扫码后识别匹配
	// 二维码包含前缀设计: user_login、APP名称
	Key string `db:"key" json:"key"`
}

FieldsQrcode 登陆专用二维码

type FieldsSave

type FieldsSave struct {
	//ID
	ID int64 `db:"id" json:"id"`
	//创建时间
	CreateAt time.Time `db:"create_at" json:"createAt"`
	//过期时间
	ExpireAt time.Time `db:"expire_at" json:"expireAt"`
	//提取密钥
	Key string `db:"key" json:"key"`
	//数据
	Data FieldsSaveReportData `db:"data" json:"data"`
}

FieldsSave 临时存储数据包 统一一分钟有效期,提取失效

type FieldsSaveReportData

type FieldsSaveReportData struct {
	//会话
	Token FieldsSaveReportDataToken `db:"token" json:"token"`
	//用户脱敏数据
	UserData UserCore.DataUserDataType `db:"user_data" json:"userData"`
	//绑定关系和组织关系
	OrgBindData []OrgCoreCore.DataGetBindByUserMarge `db:"org_bind_data" json:"orgBindData"`
	//文件集
	// id => url
	FileList map[int64]string `db:"file_list" json:"fileList"`
}

FieldsSaveReportData 反馈的数据结构

func GetSave

func GetSave(args *ArgsGetSave) (data FieldsSaveReportData, err error)

func (*FieldsSaveReportData) Scan

func (t *FieldsSaveReportData) Scan(value interface{}) error

func (FieldsSaveReportData) Value

func (t FieldsSaveReportData) Value() (driver.Value, error)

Value sql底层处理器

type FieldsSaveReportDataToken

type FieldsSaveReportDataToken struct {
	Token int64  `db:"token" json:"token"`
	Key   string `db:"key" json:"key"`
}

func (*FieldsSaveReportDataToken) Scan

func (t *FieldsSaveReportDataToken) Scan(value interface{}) error

func (FieldsSaveReportDataToken) Value

Value sql底层处理器

Jump to

Keyboard shortcuts

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