diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysTenantServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysTenantServiceImpl.java index e22f651f..ff84c9f4 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysTenantServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysTenantServiceImpl.java @@ -278,6 +278,9 @@ public class SysTenantServiceImpl implements ISysTenantService { public Boolean deleteWithValidByIds(Collection ids, Boolean isValid) { if (isValid) { // 做一些业务上的校验,判断是否需要校验 + if (ids.contains(TenantConstants.SUPER_ADMIN_ID)) { + throw new ServiceException("超管租户不能删除"); + } } return baseMapper.deleteBatchIds(ids) > 0; } diff --git a/ruoyi-ui/src/views/system/tenant/index.vue b/ruoyi-ui/src/views/system/tenant/index.vue index 3aa20f46..dac8e51f 100644 --- a/ruoyi-ui/src/views/system/tenant/index.vue +++ b/ruoyi-ui/src/views/system/tenant/index.vue @@ -360,6 +360,7 @@ export default { handleUpdate(row) { this.loading = true; this.reset(); + this.getTenantPackage(); const id = row.id || this.ids getTenant(id).then(response => { this.loading = false;