新增接口清除除参数token外这个人的token
This commit is contained in:
@@ -448,3 +448,14 @@ func DisableUser(userID, operatorUserName string) (err error) {
|
||||
func GetUserBindAuthInfo(userID string) (authList []*model.AuthBind, err error) {
|
||||
return dao.GetUserBindAuthInfo(dao.GetDB(), userID, model.AuthBindTypeAuth, nil, "", "", "")
|
||||
}
|
||||
|
||||
func DeletedTokenInfoWithoutParam(authInfo *AuthInfo) (err error) {
|
||||
userID := authInfo.UserID
|
||||
tokens, err := api.Cacher.Keys("TOKEN.V2." + userID + "*")
|
||||
for _, v := range tokens {
|
||||
if authInfo.Token != v {
|
||||
RemoveUserInfo(v)
|
||||
}
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user