| | |
| | | |
| | | // 判断账号是否重复 |
| | | //Check if the account is duplicated |
| | | User theUser = userService.getByAccount(user.getAccount()); |
| | | if (theUser != null) { |
| | | User theUser = new User(); |
| | | if (user.getAccount()!=""){ |
| | | theUser = userService.getByAccount(user.getAccount()); |
| | | |
| | | } |
| | | System.out.println("=====theUser======="+theUser); |
| | | if (theUser != null&&user.getAccount()!="") { |
| | | throw new GunsException(BizExceptionEnum.USER_ALREADY_REG); |
| | | } |
| | | |
| | |
| | | user.setCreatetime(new Date()); |
| | | |
| | | User objectUser = UserFactory.createUser(user); |
| | | objectUser.setObjectType(UserExt.getUser().getObjectType()); |
| | | objectUser.setObjectId(UserExt.getUser().getObjectId()); |
| | | //查找平台所属公司 |
| | | //Search for the company that owns the platform. |
| | | this.userService.save(objectUser); |
| | |
| | | return pictureName; |
| | | } |
| | | |
| | | /** |
| | | * 上传图片 |
| | | */ |
| | | /** |
| | | * 上传图片Amis |
| | | */ |
| | | @RequestMapping(method = RequestMethod.POST, path = "/uploadImgAmis") |
| | | @ResponseBody |
| | | public ResultUtil uploadImgAmis(@RequestPart("file") MultipartFile picture, HttpServletResponse response) { |
| | | String value = ""; |
| | | try { |
| | | value = OssUploadUtil.ossUpload("img/", picture); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | System.out.println("图片返回地址-------"+value); |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("value",value); |
| | | // return ResultUtil.success(0,map); |
| | | return ResultUtil.getResult(0,null,null,map); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequestMapping(method = RequestMethod.POST, path = "/uploadFile") |