Browse Source

调整初始密码位置

RuoYi 6 years ago
parent
commit
2345dfdf42

+ 1 - 6
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java

@@ -22,7 +22,6 @@ import com.ruoyi.framework.shiro.service.SysPasswordService;
 import com.ruoyi.framework.util.ShiroUtils;
 import com.ruoyi.framework.web.base.BaseController;
 import com.ruoyi.system.domain.SysUser;
-import com.ruoyi.system.service.ISysConfigService;
 import com.ruoyi.system.service.ISysPostService;
 import com.ruoyi.system.service.ISysRoleService;
 import com.ruoyi.system.service.ISysUserService;
@@ -47,9 +46,6 @@ public class SysUserController extends BaseController
     @Autowired
     private ISysPostService postService;
     
-    @Autowired
-    private ISysConfigService configService;
-
     @Autowired
     private SysPasswordService passwordService;
 
@@ -90,8 +86,7 @@ public class SysUserController extends BaseController
         ExcelUtil<SysUser> util = new ExcelUtil<SysUser>(SysUser.class);
         List<SysUser> userList = util.importExcel(file.getInputStream());
         String operName = getSysUser().getLoginName();
-        String password = configService.selectConfigByKey("sys.user.initPassword");
-        String message = userService.importUser(userList, updateSupport, operName, password);
+        String message = userService.importUser(userList, updateSupport, operName);
         return AjaxResult.success(message);
     }
 

+ 1 - 2
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java

@@ -145,8 +145,7 @@ public interface ISysUserService
      * @param userList 用户数据列表
      * @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
      * @param operName 操作用户
-     * @param password 初始密码
      * @return 结果
      */
-    public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName, String password);
+    public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName);
 }

+ 6 - 1
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java

@@ -22,6 +22,7 @@ import com.ruoyi.system.mapper.SysRoleMapper;
 import com.ruoyi.system.mapper.SysUserMapper;
 import com.ruoyi.system.mapper.SysUserPostMapper;
 import com.ruoyi.system.mapper.SysUserRoleMapper;
+import com.ruoyi.system.service.ISysConfigService;
 import com.ruoyi.system.service.ISysUserService;
 
 /**
@@ -48,6 +49,9 @@ public class SysUserServiceImpl implements ISysUserService
 
     @Autowired
     private SysUserRoleMapper userRoleMapper;
+    
+    @Autowired
+    private ISysConfigService configService;
 
     /**
      * 根据条件分页查询用户对象
@@ -368,7 +372,7 @@ public class SysUserServiceImpl implements ISysUserService
      * @param password 初始密码
      * @return 结果
      */
-    public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName, String password)
+    public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName)
     {
         if (StringUtils.isNull(userList) || userList.size() == 0)
         {
@@ -378,6 +382,7 @@ public class SysUserServiceImpl implements ISysUserService
         int failureNum = 0;
         StringBuilder successMsg = new StringBuilder();
         StringBuilder failureMsg = new StringBuilder();
+        String password = configService.selectConfigByKey("sys.user.initPassword");
         for (SysUser user : userList)
         {
             try