From b130c1ffa4df3dabc5a7b05000f295b87088c6ce Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Mon, 8 Jun 2020 16:08:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dsql=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/metersphere/service/OrganizationService.java | 4 ++++ frontend/src/business/components/settings/system/User.vue | 4 ++-- frontend/src/common/js/ajax.js | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/service/OrganizationService.java b/backend/src/main/java/io/metersphere/service/OrganizationService.java index 0d354c7f39..a88e4f7b31 100644 --- a/backend/src/main/java/io/metersphere/service/OrganizationService.java +++ b/backend/src/main/java/io/metersphere/service/OrganizationService.java @@ -123,6 +123,10 @@ public class OrganizationService { list.add(r.getParentId()); } }); + + // ignore list size is 0 + list.add("no_such_id"); + OrganizationExample organizationExample = new OrganizationExample(); organizationExample.createCriteria().andIdIn(list); return organizationMapper.selectByExample(organizationExample); diff --git a/frontend/src/business/components/settings/system/User.vue b/frontend/src/business/components/settings/system/User.vue index 44080272a7..3881cac0c7 100644 --- a/frontend/src/business/components/settings/system/User.vue +++ b/frontend/src/business/components/settings/system/User.vue @@ -336,11 +336,11 @@ rule: { id: [ {required: true, message: this.$t('user.input_id'), trigger: 'blur'}, - {min: 2, max: 20, message: this.$t('commons.input_limit', [2, 20]), trigger: 'blur'} + {min: 2, max: 50, message: this.$t('commons.input_limit', [2, 50]), trigger: 'blur'} ], name: [ {required: true, message: this.$t('user.input_name'), trigger: 'blur'}, - {min: 2, max: 20, message: this.$t('commons.input_limit', [2, 20]), trigger: 'blur'}, + {min: 2, max: 50, message: this.$t('commons.input_limit', [2, 50]), trigger: 'blur'}, { required: true, pattern: /^[\u4e00-\u9fa5_a-zA-Z0-9.ยท-]+$/, diff --git a/frontend/src/common/js/ajax.js b/frontend/src/common/js/ajax.js index 3ce85b05e0..af0021d005 100644 --- a/frontend/src/common/js/ajax.js +++ b/frontend/src/common/js/ajax.js @@ -18,6 +18,8 @@ export default { let login = function () { MessageBox.alert(i18n.t('commons.tips'), i18n.t('commons.prompt'), { callback: () => { + axios.get("/signout"); + localStorage.setItem('Admin-Token', "{}"); window.location.href = "/login" } });