login

package
v0.0.142 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorUerPassword = errors.New("用户名密码错误")

Functions

func LoginByPassword

func LoginByPassword(c *gin.Context)

验证用户名和密码 1、从cfg中获取用户名,先判断是不是admin,是进行密码比对.必须启用临时管理员配置才进行这一步 2、从DB中获取用户名密码

Types

type LoginRequest

type LoginRequest struct {
	Username  string `json:"username" binding:"required"`
	Password  string `json:"password" binding:"required"`
	LoginType int    `json:"loginType"` // 0: 普通登录, 1: LDAP登录
	Code      string `json:"code"`
}

LoginRequest 用户结构体

Jump to

Keyboard shortcuts

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