Custom logout after the jump address Shiro cancellation

1. Modify LogoutFilter redirection address

LogoutFilter logout = new LogoutFilter();
logout.setRedirectUrl(Constants.PREFIX +"/login");

2. Modify the filters ShiroFilterFactoryBean

Map<String, Filter> filters=new HashMap<>();
filters.put(“logout”,logout);

3. Modify ShiroFilterFactoryBean of filterChainDefinitionMap

Map<String, String> filterMap = new LinkedHashMap<>();
filterMap.put(Constants.PREFIX +"/logout",“logout”);

Note:
If you want to separate out as a LogoutFilter bean words, to put it ShiroFilterFactoryBean above,

Below is the code I wrote
Here Insert Picture Description

Published 296 original articles · won praise 61 · views 7084

Guess you like

Origin blog.csdn.net/LawssssCat/article/details/104072247