delete the token when delete a peer
This commit is contained in:
@@ -220,6 +220,16 @@ func (us *UserService) FlushToken(u *model.User) error {
|
||||
return global.DB.Where("user_id = ?", u.Id).Delete(&model.UserToken{}).Error
|
||||
}
|
||||
|
||||
// FlushTokenByUuid 清空token
|
||||
func (us *UserService) FlushTokenByUuid(uuid string) error {
|
||||
return global.DB.Where("device_uuid = ?", uuid).Delete(&model.UserToken{}).Error
|
||||
}
|
||||
|
||||
// FlushTokenByUuids 清空token
|
||||
func (us *UserService) FlushTokenByUuids(uuids []string) error {
|
||||
return global.DB.Where("device_uuid in (?)", uuids).Delete(&model.UserToken{}).Error
|
||||
}
|
||||
|
||||
// UpdatePassword 更新密码
|
||||
func (us *UserService) UpdatePassword(u *model.User, password string) error {
|
||||
u.Password = us.EncryptPassword(password)
|
||||
|
||||
Reference in New Issue
Block a user