💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
自定义403页面步骤如下: **1. 配置类** ```java @Configuration public class SecurityConfig extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { ... //自定义403页面 http.exceptionHandling().accessDeniedPage("/unauth"); } } ``` **2. controller层** ```java @Controller public class IndexController { @RequestMapping("/unauth") public String unauth() { return "unauth"; } } ``` **3. 测试** 当用户访问不具备权限的资源时就会显示自定义的403页面。