소스 검색

token过期code区分

gao.qiang 2 년 전
부모
커밋
d7e32995c1
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      base-framework/src/main/java/com/ozs/framework/security/handle/AuthenticationEntryPointImpl.java

+ 2 - 0
base-framework/src/main/java/com/ozs/framework/security/handle/AuthenticationEntryPointImpl.java

@@ -64,6 +64,8 @@ public class AuthenticationEntryPointImpl implements AuthenticationEntryPoint, S
                 String msg = StringUtils.format("请求访问:{},认证失败,无法访问系统资源"+format1, request.getRequestURI());
                 ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(code, msg)));
             }catch (Exception exception){
+                String msg = StringUtils.format("token已过期", request.getRequestURI());
+                ServletUtils.renderString(response, JSON.toJSONString(AjaxResult.error(402, msg)));
             }
         }
     }