Documentation ¶
Index ¶
- func ChangePassword(username string, password string, newPassword string) error
- func CheckPassword(username string, password string) error
- func CheckPasswordBackEnd(username string, password string) error
- func CheckUser(username string) bool
- func CreateUser(data *User) error
- func ScryptPassword(password string) string
- func UpdateUserInfo(username string, email string, phone string) (err error)
- type Article
- type Category
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangePassword ¶
修改密码
func CheckPasswordBackEnd ¶
检查后端登录密码
Types ¶
type User ¶
type User struct { gorm.Model UserName string `gorm:"type:varchar(20);not null" json:"username" validate:"required,min=4,max=12"` Password string `gorm:"type:varchar(100);not null" json:"password" validate:"required,min=4,max=120"` Email string `gorm:"type:varchar(100);not null" json:"email"` Phone string `gorm:"type:varchar(100);not null" json:"phone"` Role int `gorm:"type:int;not null" json:"role" validate:"min=0,max=2"` }
Click to show internal directories.
Click to hide internal directories.