@RequestMapping(value = "/UpdateUser", method = RequestMethod.POST) @ResponseBody public String UpdateUser(@RequestBody String userStr, HttpServletRequest request) { String data = Utils.getJsonData(userStr); JSONObject json = (JSONObject) JSON.parse(data); String userId = json.getString("userId");//从cookie中获取部门编码 Cookie[] cookies = request.getCookies(); String deptCd = null; for(Cookie cookie:cookies){ if(cookie.getName().equals("deptCd")){ deptCd = cookie.getValue(); } } return null; }