新增接口清除除参数token外这个人的token

This commit is contained in:
苏尹岚
2020-04-13 10:30:24 +08:00
parent 81d63e1741
commit 11cdb8828d
3 changed files with 37 additions and 1 deletions

View File

@@ -306,3 +306,19 @@ func (c *Auth2Controller) ChangePassword() {
return retVal, "", err
})
}
// @Title 清除除参数token以外的这个人的token
// @Description 清除除参数token以外的这个人的token
// @Param token header string true "认证token"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /DeletedTokenInfoWithoutParam [put]
func (c *Auth2Controller) DeletedTokenInfoWithoutParam() {
c.callDeletedTokenInfoWithoutParam(func(params *tAuth2DeletedTokenInfoWithoutParamParams) (retVal interface{}, errCode string, err error) {
newAuthInfo, err2 := auth2.GetTokenInfo(params.Token)
if err = err2; err == nil {
err = auth2.DeletedTokenInfoWithoutParam(newAuthInfo)
}
return retVal, "", err
})
}