自动化立体仓库 - WMS系统
#
whycq
2023-06-25 cb332ad28573e61418e5b41ef5db4b913e2dc277
#
4个文件已修改
19 ■■■■ 已修改文件
src/main/java/com/zy/common/web/AuthController.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/web/BaseController.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/role/role.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/role/rolePower.js 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/web/AuthController.java
@@ -274,6 +274,7 @@
        if (!Cools.isEmpty(powers)){
            List<PowerDto> dtos = JSON.parseArray(powers, PowerDto.class);
            for (PowerDto dto : dtos) {
                if (isNumber(dto.getTwo())) {
                Resource resource = resourceService.selectOne(new EntityWrapper<Resource>().eq("id", dto.getTwo()).eq("level", 2));
                if (!Cools.isEmpty(resource)) {
                    // 校验上级权限
@@ -287,6 +288,7 @@
                    roleResource.setRoleId(roleId);
                    roleResource.setResourceId(resource.getId());
                    roleResourceService.insert(roleResource);
                    }
                } else {
                    Permission permission = permissionService.selectOne(new EntityWrapper<Permission>().eq("action", dto.getTwo()));
                    if (!Cools.isEmpty(permission)){
@@ -303,7 +305,7 @@
                        if (leaderId != null) {
                            RoleResource roleResource = roleResourceService.selectOne(new EntityWrapper<RoleResource>().eq("role_id", leaderId).eq("resource_id", resource1.getId()));
                            if (null == roleResource) {
                                throw new CoolException(resource.getName().concat("的").concat(resource1.getName().concat("无法授权给").concat(role.getName())));
                                throw new CoolException(resource1.getName().concat("无法授权给").concat(role.getName()));
                            }
                        }
                        RoleResource roleResource = new RoleResource();
src/main/java/com/zy/common/web/BaseController.java
@@ -184,4 +184,13 @@
            wrapper.like(columns.get(i), condition);
        }
    }
    public static boolean isNumber(String str){
        for (int i = str.length();--i>=0;){
            if (!Character.isDigit(str.charAt(i))){
                return false;
            }
        }
        return true;
    }
}
src/main/webapp/static/js/role/role.js
@@ -273,6 +273,7 @@
                    shadeClose: false,
                    content: 'role_power_detail.html',
                    success: function(layero, index){
                    }
                });
                break;
src/main/webapp/static/js/role/rolePower.js
@@ -40,12 +40,15 @@
        var param = [];
        var checkData = tree.getChecked('powerTree');
        checkData.map(function (obj) {
            console.log(obj)
            obj.children.map(function (resource) {
                console.log(resource)
                var childrens = [];
                if (resource.children) {
                resource.children.map(function (resource) {
                    childrens.push(resource.id);
                });
                }
                var one = {
                    'two': resource.id,
                    'three': childrens