22 lines
649 B
Java
22 lines
649 B
Java
package com.njzscloud.dispose.config;
|
|
|
|
import com.njzscloud.common.security.util.SecurityUtil;
|
|
import lombok.RequiredArgsConstructor;
|
|
import org.springframework.boot.context.event.ApplicationReadyEvent;
|
|
import org.springframework.context.event.EventListener;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import java.util.List;
|
|
|
|
import static com.njzscloud.dispose.event.SysMittEvent.COERCE_LOGOUT;
|
|
|
|
@Component
|
|
@RequiredArgsConstructor
|
|
public class SpringReady {
|
|
|
|
@EventListener(ApplicationReadyEvent.class)
|
|
public void onApplicationReady() {
|
|
COERCE_LOGOUT.on((List<Long> ids) -> ids.forEach(SecurityUtil::removeToken));
|
|
}
|
|
}
|