diff --git a/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/impl/DeviceServiceImpl.java b/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/impl/DeviceServiceImpl.java index 10123873..d745caab 100644 --- a/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/impl/DeviceServiceImpl.java +++ b/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/impl/DeviceServiceImpl.java @@ -247,9 +247,11 @@ public class DeviceServiceImpl implements IDeviceService { if(roles.get(i).getRoleKey().equals("tenant")){ // 租户查看产品下所有设备 device.setTenantId(user.getUserId()); + break; }else if (roles.get(i).getRoleKey().equals("general")){ // 用户查看自己设备 device.setUserId(user.getUserId()); + break; } } return deviceMapper.selectAllDeviceShortList(device); diff --git a/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/impl/GroupServiceImpl.java b/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/impl/GroupServiceImpl.java index f0545867..010d1b36 100644 --- a/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/impl/GroupServiceImpl.java +++ b/springboot/wumei-iot/src/main/java/com/ruoyi/iot/service/impl/GroupServiceImpl.java @@ -67,8 +67,8 @@ public class GroupServiceImpl implements IGroupService SysUser user = getLoginUser().getUser(); List roles=user.getRoles(); for(int i=0;i and product_name like concat('%', #{productName}, '%') and user_id = #{userId} and user_name like concat('%', #{userName}, '%') - and (tenant_id = #{tenantId} or is_sys = 1) + and tenant_id = #{tenantId} and tenant_name like concat('%', #{tenantName}, '%') and serial_number = #{serialNumber} and status = #{status} diff --git a/springboot/wumei-iot/src/main/resources/mapper/iot/FirmwareMapper.xml b/springboot/wumei-iot/src/main/resources/mapper/iot/FirmwareMapper.xml index 24d9de25..894699b6 100644 --- a/springboot/wumei-iot/src/main/resources/mapper/iot/FirmwareMapper.xml +++ b/springboot/wumei-iot/src/main/resources/mapper/iot/FirmwareMapper.xml @@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and firmware_name like concat('%', #{firmwareName}, '%') and product_name like concat('%', #{productName}, '%') - and (tenant_id = #{tenantId} or is_sys = 1) + and tenant_id = #{tenantId} order by create_time desc diff --git a/springboot/wumei-iot/src/main/resources/mapper/iot/ProductMapper.xml b/springboot/wumei-iot/src/main/resources/mapper/iot/ProductMapper.xml index b7756a6a..bb8a7db4 100644 --- a/springboot/wumei-iot/src/main/resources/mapper/iot/ProductMapper.xml +++ b/springboot/wumei-iot/src/main/resources/mapper/iot/ProductMapper.xml @@ -46,7 +46,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and status = #{status} and device_type = #{deviceType} and network_method = #{networkMethod} - and (tenant_id = #{tenantId} or is_sys = 1) + and tenant_id = #{tenantId} order by create_time desc diff --git a/vue/src/views/iot/category/index.vue b/vue/src/views/iot/category/index.vue index f2db0ad7..9110360d 100644 --- a/vue/src/views/iot/category/index.vue +++ b/vue/src/views/iot/category/index.vue @@ -32,8 +32,8 @@ @@ -54,7 +54,7 @@ @@ -77,8 +77,8 @@ export default { dicts: ["iot_yes_no"], data() { return { - // 判断是否获取到修改权限 - canEdit: false, + // 是否为租户 + isTenant: false, // 遮罩层 loading: true, // 选中数组 @@ -127,8 +127,8 @@ export default { }, methods: { init() { - if (this.$store.state.user.roles.indexOf("admin") !== -1) { - this.canEdit = true + if (this.$store.state.user.roles.indexOf("tenant") !== -1) { + this.isTenant = true } }, /** 查询产品分类列表 */ diff --git a/vue/src/views/iot/device/index.vue b/vue/src/views/iot/device/index.vue index 475169f9..934ea0eb 100644 --- a/vue/src/views/iot/device/index.vue +++ b/vue/src/views/iot/device/index.vue @@ -137,6 +137,7 @@ + diff --git a/vue/src/views/iot/firmware/index.vue b/vue/src/views/iot/firmware/index.vue index 4832a6dc..eeb90753 100644 --- a/vue/src/views/iot/firmware/index.vue +++ b/vue/src/views/iot/firmware/index.vue @@ -19,15 +19,10 @@ - + - - -