token问题

This commit is contained in:
2024-06-01 21:34:43 +08:00
parent a375fb10a8
commit c85f82f385
2 changed files with 34 additions and 16 deletions

View File

@@ -122,6 +122,15 @@ public class LoginFilter implements Filter {
response.getWriter().flush();//流里边的缓存刷出
return;
}
JSONObject jsonObject1 = TokenUtil.parseParamFromToken(token);
if (jsonObject1.containsKey("status")){
Result result = new Result(CodeEnum.TOKEN_EXPIRED);
String jsonString = JSONObject.toJSONString(result);
JSONObject jsonObject = JSONObject.parseObject(jsonString, JSONObject.class);
response.getWriter().print(jsonObject);
response.getWriter().flush();//流里边的缓存刷出
return;
}
chain.doFilter(req, resp);
}