From 96ec5fac99f3fc870101333ca43f1f106d9cb3f9 Mon Sep 17 00:00:00 2001 From: BaiJiangJie <32935519+BaiJiangJie@users.noreply.github.com> Date: Mon, 6 Aug 2018 18:17:17 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E6=9B=B4=E6=96=B0=20xpack/orgs=20?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=8A=9F=E8=83=BD=EF=BC=9A=E9=99=90=E5=88=B6?= =?UTF-8?q?=E5=9C=A8=E5=BD=93=E5=89=8Dorg=E4=B8=8B=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=BD=93=E5=89=8Dorg=20(#1645)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/static/js/jumpserver.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/static/js/jumpserver.js b/apps/static/js/jumpserver.js index 859d399e8..e0e7a2d6e 100644 --- a/apps/static/js/jumpserver.js +++ b/apps/static/js/jumpserver.js @@ -179,7 +179,7 @@ function APIUpdateAttr(props) { toastr.error(fail_message); } if (typeof props.error === 'function') { - return props.error(jqXHR.responseText); + return props.error(jqXHR.responseText, jqXHR.status); } }); // return true; @@ -234,8 +234,13 @@ function orgDelete(obj, name, url, redirectTo){ window.location.href=redirectTo; } }; - var fail = function() { - swal("错误", "[ " + name + " ] 组织中存在未删除信息,请删除后重试", "error"); + var fail = function(responseText, status) { + if (status === 400){ + swal("错误", "[ " + name + " ] 组织中包含未删除信息,请删除后重试", "error"); + } + else if (status === 405){ + swal("错误", "请勿在组织 [ "+ name + " ] 下执行此操作,切换到其他组织后重试", "error"); + } }; APIUpdateAttr({ url: url, @@ -247,7 +252,7 @@ function orgDelete(obj, name, url, redirectTo){ }); } swal({ - title: "请先删除组织内的以下信息:", + title: "请确保组织内的以下信息已删除", text: "用户列表、用户组、资产列表、网域列表、管理用户、系统用户、标签管理、资产授权规则", type: "warning", showCancelButton: true,