* @throws Exception
*/
@RequestMapping(params = "saveOrUpdateIcon", method = RequestMethod.POST)
@ResponseBody
public AjaxJson saveOrUpdateIcon(HttpServletRequest request) throws Exception {
AjaxJson j = new AjaxJson();
TSIcon icon = new TSIcon();
Short iconType = oConvertUtils.getShort(request.getParameter("iconType"));
String iconName = oConvertUtils.getString(request.getParameter("iconName"));
String id = request.getParameter("id");
icon.setId(id);
icon.setIconName(iconName);
icon.setIconType(iconType);
// uploadFile.setBasePath("images/accordion");
UploadFile uploadFile = new UploadFile(request, icon);
uploadFile.setCusPath("plug-in/accordion/images");
uploadFile.setExtend("extend");
uploadFile.setTitleField("iconclas");
uploadFile.setRealPath("iconPath");
uploadFile.setObject(icon);
uploadFile.setByteField("iconContent");
uploadFile.setRename(false);
systemService.uploadFile(uploadFile);
// 图标的css样式
String css = "." + icon.getIconClas() + "{background:url('../images/" + icon.getIconClas() + "." + icon.getExtend() + "') no-repeat}";
write(request, css);
message = "上传成功";
j.setMsg(message);
return j;
}