From e7242d40110c8a157867acd2d1a1718fb640d4c5 Mon Sep 17 00:00:00 2001 From: zlyx <1242874891@qq.com> Date: Fri, 17 Feb 2023 16:02:04 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E6=AD=A3=20SysTenantServiceImpl?= =?UTF-8?q?#deleteWithValidByIds=20=E8=B6=85=E7=AE=A1=E7=A7=9F=E6=88=B7?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E8=A2=AB=E5=88=A0=E9=99=A4=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98,=20=E5=8A=A0=E4=B8=8A=20id=20=E6=A0=A1=E9=AA=8C=20;?= =?UTF-8?q?=20fix=20=E4=BF=AE=E6=AD=A3=20tenant/index.vue=20handleUpdate?= =?UTF-8?q?=20=E7=A7=9F=E6=88=B7=E5=A5=97=E9=A4=90=E5=9B=9E=E6=98=BE?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/system/service/impl/SysTenantServiceImpl.java | 3 +++ ruoyi-ui/src/views/system/tenant/index.vue | 1 + 2 files changed, 4 insertions(+) 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;