package com.bcxin.ars.filter;

import com.bcxin.ars.dto.AjaxResult;
import com.bcxin.ars.rest.util.ResponseJsonUtils;
import com.bcxin.ars.util.Constants;
import lombok.Data;
import org.apache.shiro.web.filter.authc.FormAuthenticationFilter;
import org.apache.shiro.web.util.WebUtils;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;

/**
 * @author linqinglin
 * @date 2020/06/05 0005 10:31
 */
@Data
public class BaseAuthcFilter extends FormAuthenticationFilter {
    @Override
    protected void redirectToLogin(ServletRequest request, ServletResponse response) throws IOException {
        ResponseJsonUtils.writeJSON(response, AjaxResult.unLogin());
    }
}
