@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;
}
Java后台方法从cookie中获取部门编码
未经允许不得转载:搜云库技术团队 » Java后台方法从cookie中获取部门编码