怎样在Win7系统中搭建Web服务器
详见百度搭建教程web服务器搭建
web服务器搭建
搭建好服务器以后配置
controller层
/**
* 上传头像
*/
@RequestMapping(value="uploadPhotoHead")//, produces = {"application/json;charset=UTF-8"}
@ResponseBody
public String uploadPhotoHead(HttpServletRequest request,Integer userId){
Result<String> result=new Result<>(false);
try {
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
MultipartFile file = multipartRequest.getFile("upFile");
result=userBizService.uploadPhotoHead(file,userId);
} catch (Exception e) {
result.setMessage(e.getMessage());
}
return result.toJsonResult();
}
UserBizServiceImpl实现类
@Override
@Transactional(readOnly = false)
public Result<String> uploadPhotoHead(MultipartFile file,Integer userId) {
Result<String> result=new Result<>(false);
User user