auth

package
v0.0.0-...-6e4d488 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserNameOrPassword = errors.New("手机号或密码错误")
)

Functions

func Login

func Login(ctx iris.Context)

Login 登录 - LoginRequest 登录需要提交 uesrname 和 password 字段到接口 - validate.ValidRequest 验证接口提交参数,需要在 LoginRequest 的字段设置 validate:"required" - GetAccessToken 生成验证 token

func Party

func Party() module.WebModule

Party 认证模块

Types

type LoginOaResponse

type LoginOaResponse struct {
	Token    string `json:"token"`
	Uuid     string `gorm:"type:varchar(36);" json:"uuid"`
	NickName string `gorm:"type:varchar(60)" json:"nickname"`
	Name     string `gorm:"type:varchar(60)" json:"name"`
}

func GetAccessToken

func GetAccessToken(req *LoginRequest) (LoginOaResponse, error)

GetAccessToken 登录

type LoginRequest

type LoginRequest struct {
	Mobile   string `json:"mobile" validate:"required"`
	Password string `json:"password" validate:"required"`
}

LoginRequest 登录请求字段

func (*LoginRequest) Request

func (req *LoginRequest) Request(ctx iris.Context) error

Jump to

Keyboard shortcuts

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