diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/system/SysUserController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/system/SysUserController.java index 8b23ec2..3ba6013 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/system/SysUserController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/system/SysUserController.java @@ -1,18 +1,22 @@ package com.ruoyi.web.controller.system.system; +import java.io.IOException; import java.util.List; import java.util.stream.Collectors; + +import com.ruoyi.common.config.RuoYiConfig; +import com.ruoyi.common.exception.file.InvalidExtensionException; +import com.ruoyi.common.utils.file.FileUploadUtils; +import com.ruoyi.common.utils.file.MimeTypeUtils; import org.apache.commons.lang3.ArrayUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.controller.BaseController; @@ -43,6 +47,7 @@ import com.ruoyi.system.service.ISysUserService; @RequestMapping("/system/user") public class SysUserController extends BaseController { + private static final Logger log = LoggerFactory.getLogger(SysUserController.class); private String prefix = "system/user"; @Autowired @@ -127,8 +132,7 @@ public class SysUserController extends BaseController @Log(title = "用户管理", businessType = BusinessType.INSERT) @PostMapping("/add") @ResponseBody - public AjaxResult addSave(@Validated SysUser user) - { + public AjaxResult addSave(@Validated SysUser user) { if (!userService.checkLoginNameUnique(user)) { return error("新增用户'" + user.getLoginName() + "'失败,登录账号已存在"); diff --git a/ruoyi-admin/src/main/resources/templates/system/user/add.html b/ruoyi-admin/src/main/resources/templates/system/user/add.html index 8bd9525..d8d80c0 100644 --- a/ruoyi-admin/src/main/resources/templates/system/user/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/user/add.html @@ -167,6 +167,32 @@ + +