自动化立体仓库 - WMS系统
#
whycq
2024-12-27 f754e34c3822811bace989fae6a69dbcc3944d13
src/main/java/com/zy/system/controller/UserController.java
@@ -104,6 +104,15 @@
   @RequestMapping(value = "/user/update/auth")
    @ManagerAuth(memo = "系统用户修改")
    public R update(User user){
        if (getUserId() != 9527){
            if (!getUserId().equals(user.getId())){
                Role role = roleService.selectById(getUser().getRoleId());
                if (!role.getCode().equals("admin")){
                    return R.error("操作越权!");
                }
            }
        }
        if (Cools.isEmpty(user) || null==user.getId()){
            return R.error();
        }
@@ -117,7 +126,13 @@
        if (user.getMobile()!=null) {
            entity.setMobile(user.getMobile());
        }
        userService.updateById(entity);
        if (user.getRoleId()!=null){
            entity.setRoleId(user.getRoleId());
        }
        if (!userService.updateById(entity)){
            return R.error("修改失败!");
        }
        return R.ok();
    }