package com.sjyt.icom.asst.conf;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


/**
 * @author: Tab
 * @date: 2022-06-11 14:40
 * @since 1.0.0
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {
    //解决  No mapping for GET  访问静态资源
//    public void addResourceHandlers(ResourceHandlerRegistry registry){
//        registry.addResourceHandler("/**")
//                .addResourceLocations("classpath:/");
//
//    }
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
//        spring.mvc.view.prefix + /index + spring.mvc.view.suffix 构成完整的请求地址
//=        访问项目根目录即是访问 /views/index.html页面
        registry.addViewController("/").setViewName("/index");
    }
    //http(https)://ip:port/访问本地址
//    public void addViewControllers(ViewControllerRegistry registry){
//        registry.addViewController("/").setViewName("client");
//    }

}
