springboot拦截器返回json数据给前端
时间:2020-02-24 15:06:40
收藏:0
阅读:1152
if(StringUtils.isEmpty(token)){
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json; charset=utf-8");
PrintWriter out = null;
JSONObject res = new JSONObject();
res.put("success", false);
res.put("message", "请携带token");
out = response.getWriter();
out.append(res.toString());
return false;
}
原文:https://www.cnblogs.com/zhangjiahao/p/12356644.html
评论(0)