配置默认访问页面
创建一个类
package com.yzx.boot.config;
import com.yzx.boot.interceptor.AuthInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import javax.annotation.Resource;
/**
* @program: SpringBoot_xiangmu
* @description: 配置授权拦截器
* @author: yzx
* @create: 2021-12-29 20:24
**/
@Configuration
public class WebMvcConfig extends WebMvcConfigurerAdapter implements WebMvcConfigurer {
//配置默认访问页面
@Override
public void addViewControllers(ViewControllerRegistry registry) {
//登录的路径
registry.addViewController("/").setViewName("/page/end/login");
registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
super.addViewControllers(registry);
}
}