首页>代码>基于SpringBoot实现的学生就业管理系统>/源代码/employment/src/main/java/com/project/config/LoginConfig.java
package com.project.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.*;

/**
 * @author: liangrenren
 * @date: 2021-03-04 11:30
 **/
@Configuration
public class LoginConfig extends WebMvcConfigurationSupport {

    @Value("${upload}")
    private String upload;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        InterceptorRegistration registration = registry.addInterceptor(new AdminInterceptor());
        registration.addPathPatterns("/**");
        registration.excludePathPatterns(
                "/user/login",
                "/user/getVerificationCode",
                "/upload/**",
                "/user/addCompany",
                "/image/**",
                "/js/**",
                "/lib/**",
                "/index.html");
    }

    @Override
    protected void addResourceHandlers(ResourceHandlerRegistry registry) {
        super.addResourceHandlers(registry);
        registry.addResourceHandler("/**").addResourceLocations("classpath:/META-INF/resources/")
                .addResourceLocations("classpath:/static/");
        registry.addResourceHandler("/upload/**").addResourceLocations("file:" + upload);
    }
}
最近下载更多
最代码官方  LV168 11月2日
最近浏览更多
是数据库  LV3 昨天
yimaoermao  LV1 昨天
xiaozhi丶  LV15 昨天
罗清晨  LV13 前天
最代码官方  LV168 11月2日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友