关于security的权限问题
来源:5-3 权限控制
背影淋湿了脸
2018-10-30

http.authorizeRequests()
.antMatchers("/admin/login").permitAll()
.antMatchers("/static/").permitAll()
.antMatchers("/user/login").permitAll()
.antMatchers("/admin/").hasRole(“ADMIN”)
.antMatchers("/user/").hasAnyRole(“ADMIN”,“USER”)
.antMatchers("/api/user/").hasAnyRole(“ADMIN”,“USER”)
.and()
.formLogin()
.loginProcessingUrl("/login")//配置角色登陆配置处理入口
.and()
.logout()
.logoutUrl("/logout")
.logoutSuccessUrl("/logout/page")
.deleteCookies(“JSESSIONID”)
.invalidateHttpSession(true)
.and()
.exceptionHandling()
.authenticationEntryPoint(entryPoint())
.accessDeniedPage("/403");
http.csrf().disable();
http.headers().frameOptions().sameOrigin();
老师好,为什么已经登陆了,访问admin目录下或者user目录下的页面,总显示无权限呢
1回答
-
背影淋湿了脸
提问者
2018-10-31
这个问题已经解决了
112018-12-07
相似问题