package com.ruoyi.web.modules.account.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import com.ruoyi.web.modules.account.support.MemberAuthInterceptor;

/**
 * 会员 Web 配置
 */
@Configuration
public class MemberWebConfig implements WebMvcConfigurer
{
    @Autowired
    private MemberAuthInterceptor memberAuthInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry)
    {
        registry.addInterceptor(memberAuthInterceptor)
                .addPathPatterns("/api/member/**", "/api/merchant/entry/apply", "/api/merchant/entry/my",
                        "/api/shop/*/follow", "/api/cart/**", "/api/checkout/**", "/api/order/**")
                .excludePathPatterns("/api/member/register", "/api/member/login", "/api/member/sms/send",
                        "/api/member/serviceAgreement", "/api/member/serviceAgreement/**");
    }
}
