From d6f0958babd71a1dc9d24496076f763f86d76ac7 Mon Sep 17 00:00:00 2001 From: 44323 <443237572@qq.com> Date: 星期五, 27 十月 2023 13:08:53 +0800 Subject: [PATCH] 商户认证 --- cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/UserMgrController.java | 32 +++++++++++++++++++++++++++++--- 1 files changed, 29 insertions(+), 3 deletions(-) diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/UserMgrController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/UserMgrController.java index ee71eca..0672197 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/UserMgrController.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/UserMgrController.java @@ -205,8 +205,13 @@ // 判断账号是否重复 //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); } @@ -217,6 +222,8 @@ 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); @@ -379,7 +386,25 @@ */ @RequestMapping(method = RequestMethod.POST, path = "/uploadImg") @ResponseBody - public ResultUtil uploadImg(@RequestPart("file") MultipartFile picture, HttpServletResponse response) { + public String uploadImg(@RequestPart("file") MultipartFile picture) { + String pictureName = ""; + try { + pictureName = OssUploadUtil.ossUpload("img/", picture); + }catch (Exception e){ + e.printStackTrace(); + } + 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); @@ -395,6 +420,7 @@ + @RequestMapping(method = RequestMethod.POST, path = "/uploadFile") @ResponseBody public String uploadFile(@RequestPart("file") MultipartFile picture) { -- Gitblit v1.7.1