v1

package
v0.0.0-...-fc9f0a5 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ExpireTime = 3600000 //token有效期

	//TODO
	//SignName = "你我"
	SignName = "ABC商城"
)

Functions

func AddUserInfo

func AddUserInfo(ctx iris.Context)

func GetUserInfo

func GetUserInfo(ctx iris.Context)

func GetVerificationCode

func GetVerificationCode(ctx iris.Context)

func Login

func Login(ctx iris.Context)

func Logout

func Logout(ctx iris.Context)

退出清空验证码、token、refreshToken

func RegisterUser

func RegisterUser(ctx iris.Context)

func UpdatePassword

func UpdatePassword(ctx iris.Context)

func UpdateToken

func UpdateToken(ctx iris.Context)

用户通过refreshToken更新token

func UpdateUserInfo

func UpdateUserInfo(ctx iris.Context)

func VerifyLogin

func VerifyLogin(ctx iris.Context)

用户打开app验证token是否过期来确认登陆,过期返回warning

Types

type GetVerificationCodeReq

type GetVerificationCodeReq struct {
	PhoneNumber string `json:"phoneNumber"`
}

type JwtClaims

type JwtClaims struct {
	jwt.StandardClaims
	PhoneNumber      string
	VerificationCode string
}

type LoginResponseInfo

type LoginResponseInfo struct {
	PhoneNumber  string `json:"phoneNumber"`
	Name         string `json:"name"`
	Token        string `json:"token"`
	RefreshToken string `json:"refreshToken"`
}

type LogoutReq

type LogoutReq struct {
	PhoneNumber string `json:"phoneNumber"`
}

type ResponseContent

type ResponseContent struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

type UpdateTokenReq

type UpdateTokenReq struct {
	PhoneNumber string `json:"phoneNumber"`
	FreshToken  string `json:"freshToken"`
}

type UserRegistrationOrLoginReq

type UserRegistrationOrLoginReq struct {
	//Name string `json:"name"`
	//Email string `json:"email"`
	PhoneNumber string `json:"phoneNumber"`
	//Password string `json:"password"`
	VerificationCode string `json:"verificationCode"`
}

type VerifyLoginReq

type VerifyLoginReq struct {
	PhoneNumber string `json:"phoneNumber"`
	Token       string `json:"token"`
}

Jump to

Keyboard shortcuts

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