| | |
| | | import com.alibaba.druid.util.StringUtils; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.google.common.collect.Maps; |
| | | import com.google.gson.Gson; |
| | | import com.nq.annotation.SameUrlData; |
| | | import com.nq.common.ServerResponse; |
| | | import com.nq.pojo.User; |
| | |
| | | } |
| | | User currentUser = getCurrentUser(httpServletRequest); |
| | | if (null == currentUser) { |
| | | // httpServletResponse.reset(); |
| | | httpServletResponse.setCharacterEncoding("UTF-8"); |
| | | httpServletResponse.setContentType("application/json;charset=UTF-8"); |
| | | PrintWriter writer = httpServletResponse.getWriter(); |
| | | Map map = Maps.newHashMap(); |
| | | map.put("success", Boolean.valueOf(false)); |
| | | map.put("msg", "Please Login"); |
| | | writer.print(JsonUtil.obj2String(map)); |
| | | writer.print( new Gson().toJson(ServerResponse.createByErrorCodeMsg(401,"请登录"))); |
| | | writer.flush(); |
| | | writer.close(); |
| | | return false; |
| | | } |
| | | String uri = httpServletRequest.getRequestURI(); |
| | | |
| | | |
| | | //验证重复点击与接口权限等 |
| | | Boolean checkFlag = checkUri(httpServletResponse, handler, uri,currentUser); |
| | | if (!checkFlag) { |