kongzy
2024-09-14 f0f00e9ba8a755e4317e029d73b69a92ad9f9df1
exam-framework/src/main/java/com/gkhy/exam/framework/security/handle/AuthenticationEntryPointImpl.java
@@ -2,6 +2,7 @@
import com.alibaba.fastjson2.JSON;
import com.gkhy.exam.common.api.CommonResult;
import com.gkhy.exam.common.api.ResultCode;
import com.gkhy.exam.common.utils.ServletUtils;
import com.gkhy.exam.common.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
@@ -30,7 +31,7 @@
    {
        String msg = StringUtils.format("请求访问:{},认证失败,无法访问系统资源", request.getRequestURI());
        log.error(msg);
        ServletUtils.renderString(response, JSON.toJSONString(CommonResult.failed(msg)));
        ServletUtils.renderString(response, JSON.toJSONString(CommonResult.failed(ResultCode.UNAUTHORIZED,msg)));
    }
}