管道基础大数据平台系统开发-【后端】-Server
13693261870
2024-04-22 cc816055746ae0ffa870734e5a411b2a2aabb96a
src/main/java/com/lf/server/config/WebConfig.java
@@ -4,9 +4,10 @@
import com.alibaba.fastjson.support.config.FastJsonConfig;
import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter;
import com.lf.server.interceptor.AuthInterceptor;
import com.lf.server.service.sys.TokenService;
import com.lf.server.service.all.SysService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.util.AntPathMatcher;
import org.springframework.web.servlet.config.annotation.*;
@@ -21,7 +22,15 @@
@Configuration
public class WebConfig extends WebMvcConfigurationSupport {
    @Autowired
    private TokenService tokenService;
    private SysService sysService;
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        // 设置访问路径为 “/” 跳转到指定页面
        registry.addViewController("/").setViewName("redirect:/sign/toIndex");
        // 设置为最高优先级
        registry.setOrder(Ordered.HIGHEST_PRECEDENCE);
    }
    /**
     * 获取拦截器对象
@@ -29,7 +38,7 @@
     * @return
     */
    public AuthInterceptor getAuthBean() {
        return new AuthInterceptor(tokenService);
        return new AuthInterceptor(sysService);
    }
    /**