Documentation
¶
Index ¶
- func AccessToken(context iris.Context)
- func Cancel(context iris.Context)
- func Check(context iris.Context)
- func CheckRequestClient(context iris.Context) (bool, string)
- func RefreshToken(context iris.Context)
- type ApiResponseJson
- type CancelTokenRequestJson
- type CheckTokenRequestJson
- type LoginRequestJson
- type LoginResponseJson
- type RefreshTokenRequestJson
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccessToken ¶
*
- 登录获取Token(可以任意次数重复登录以刷新AccessToken和RefreshToken)
- @method AccessToken
- @param iris.Context context [IRIS上下文]
func CheckRequestClient ¶
*
- 校验客户端配置信息是否符合标准
- @method checkRequestClient
- @param iris.Context context [IRIS上下文]
func RefreshToken ¶
*
- 根据RefreshToken刷新AccessToken
- 1、若access_token已超时,那么进行refresh_token会获取一个新的access_token,新的超时时间;
- 2、若access_token未超时,那么进行refresh_token不会改变access_token,但超时时间会刷新,相当于续期access_token
- 3、refresh_token在执行刷新之后是不会变的
- @method RefreshToken
- @param iris.Context context [IRIS上下文]
Types ¶
type ApiResponseJson ¶
type ApiResponseJson struct { Status bool `json:"status"` Msg interface{} `json:"msg"` Data interface{} `json:"data"` }
func ApiResource ¶
func ApiResource(status bool, objects interface{}, msg string) (apiJson *ApiResponseJson)
func ApiResourceError ¶
func ApiResourceError(msg string) (apiJson *ApiResponseJson)
func ApiResourceSuccess ¶
func ApiResourceSuccess(objects interface{}) (apiJson *ApiResponseJson)
type CancelTokenRequestJson ¶
type CancelTokenRequestJson struct {
GrantType string `json:"grant_type" validate:"required"`
}
type CheckTokenRequestJson ¶
type LoginRequestJson ¶
type LoginResponseJson ¶
type RefreshTokenRequestJson ¶
Click to show internal directories.
Click to hide internal directories.