From 092b9a5ca4884c4ca99b2b6a8eec6d1b00ed0812 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cliuliaozhong=E2=80=9D?= <“liuliaozhong@canway.net”> Date: Tue, 3 Jan 2023 18:50:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0=E6=9D=83=E9=99=90=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=B8=A6=E4=B8=8A=E7=94=A8=E6=88=B7=E5=90=8D?= =?UTF-8?q?=20#784?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/i18n/exception/message.properties | 4 ++-- .../src/main/resources/i18n/exception/message_en.properties | 4 ++-- .../main/resources/i18n/exception/message_en_US.properties | 4 ++-- .../src/main/resources/i18n/exception/message_zh.properties | 4 ++-- .../main/resources/i18n/exception/message_zh_CN.properties | 4 ++-- .../java/com/tencent/bk/job/common/constant/ErrorCode.java | 4 ++-- .../main/java/com/tencent/bk/job/common/model/Response.java | 3 ++- .../java/com/tencent/bk/job/common/esb/model/EsbResp.java | 3 ++- 8 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/backend/commons/common-i18n/src/main/resources/i18n/exception/message.properties b/src/backend/commons/common-i18n/src/main/resources/i18n/exception/message.properties index 741d4248f3..d7e0279648 100644 --- a/src/backend/commons/common-i18n/src/main/resources/i18n/exception/message.properties +++ b/src/backend/commons/common-i18n/src/main/resources/i18n/exception/message.properties @@ -35,8 +35,8 @@ 0=成功 ##系统错误-权限 -1238001=用户权限不足 -9900403=用户权限不足 +1238001=用户({0})权限不足,请前往权限中心确认并申请补充后重试 +9900403=用户({0})权限不足,请前往权限中心确认并申请补充后重试 1238002=用户无业务操作权限 ##系统错误-API通用 diff --git a/src/backend/commons/common-i18n/src/main/resources/i18n/exception/message_en.properties b/src/backend/commons/common-i18n/src/main/resources/i18n/exception/message_en.properties index 17a83048ce..adb00386dd 100644 --- a/src/backend/commons/common-i18n/src/main/resources/i18n/exception/message_en.properties +++ b/src/backend/commons/common-i18n/src/main/resources/i18n/exception/message_en.properties @@ -35,8 +35,8 @@ 0=Success ## System error - permissions -1238001=Insufficient user permissions -9900403=Insufficient user permissions +1238001=User ({0}) permission not allowed, please confirm and apply in IAM and try again +9900403=User ({0}) permission not allowed, please confirm and apply in IAM and try again 1238002=Insufficient user permissions for application ## System error - API common diff --git a/src/backend/commons/common-i18n/src/main/resources/i18n/exception/message_en_US.properties b/src/backend/commons/common-i18n/src/main/resources/i18n/exception/message_en_US.properties index 17a83048ce..adb00386dd 100644 --- a/src/backend/commons/common-i18n/src/main/resources/i18n/exception/message_en_US.properties +++ b/src/backend/commons/common-i18n/src/main/resources/i18n/exception/message_en_US.properties @@ -35,8 +35,8 @@ 0=Success ## System error - permissions -1238001=Insufficient user permissions -9900403=Insufficient user permissions +1238001=User ({0}) permission not allowed, please confirm and apply in IAM and try again +9900403=User ({0}) permission not allowed, please confirm and apply in IAM and try again 1238002=Insufficient user permissions for application ## System error - API common diff --git a/src/backend/commons/common-i18n/src/main/resources/i18n/exception/message_zh.properties b/src/backend/commons/common-i18n/src/main/resources/i18n/exception/message_zh.properties index 741d4248f3..d7e0279648 100644 --- a/src/backend/commons/common-i18n/src/main/resources/i18n/exception/message_zh.properties +++ b/src/backend/commons/common-i18n/src/main/resources/i18n/exception/message_zh.properties @@ -35,8 +35,8 @@ 0=成功 ##系统错误-权限 -1238001=用户权限不足 -9900403=用户权限不足 +1238001=用户({0})权限不足,请前往权限中心确认并申请补充后重试 +9900403=用户({0})权限不足,请前往权限中心确认并申请补充后重试 1238002=用户无业务操作权限 ##系统错误-API通用 diff --git a/src/backend/commons/common-i18n/src/main/resources/i18n/exception/message_zh_CN.properties b/src/backend/commons/common-i18n/src/main/resources/i18n/exception/message_zh_CN.properties index 741d4248f3..d7e0279648 100644 --- a/src/backend/commons/common-i18n/src/main/resources/i18n/exception/message_zh_CN.properties +++ b/src/backend/commons/common-i18n/src/main/resources/i18n/exception/message_zh_CN.properties @@ -35,8 +35,8 @@ 0=成功 ##系统错误-权限 -1238001=用户权限不足 -9900403=用户权限不足 +1238001=用户({0})权限不足,请前往权限中心确认并申请补充后重试 +9900403=用户({0})权限不足,请前往权限中心确认并申请补充后重试 1238002=用户无业务操作权限 ##系统错误-API通用 diff --git a/src/backend/commons/common/src/main/java/com/tencent/bk/job/common/constant/ErrorCode.java b/src/backend/commons/common/src/main/java/com/tencent/bk/job/common/constant/ErrorCode.java index a0559b4179..39370ba5bd 100644 --- a/src/backend/commons/common/src/main/java/com/tencent/bk/job/common/constant/ErrorCode.java +++ b/src/backend/commons/common/src/main/java/com/tencent/bk/job/common/constant/ErrorCode.java @@ -320,9 +320,9 @@ public class ErrorCode { // ==================================== 系统级错误 ================================================// // ======== 系统错误-权限错误 ==================// - // 用户权限不足 + // 用户({0})权限不足,请前往权限中心确认并申请补充后重试 public static final int PERMISSION_DENIED = 1238001; - // 蓝鲸统一权限错误码 + // 蓝鲸统一权限错误码,用户({0})权限不足,请前往权限中心确认并申请补充后重试 public static final int BK_PERMISSION_DENIED = 9900403; // ========= 系统错误-请求 ====================// diff --git a/src/backend/commons/common/src/main/java/com/tencent/bk/job/common/model/Response.java b/src/backend/commons/common/src/main/java/com/tencent/bk/job/common/model/Response.java index 3eebdf4d06..fae8eed059 100644 --- a/src/backend/commons/common/src/main/java/com/tencent/bk/job/common/model/Response.java +++ b/src/backend/commons/common/src/main/java/com/tencent/bk/job/common/model/Response.java @@ -93,7 +93,8 @@ public static Response buildSuccessResp(T data) { } public static Response buildAuthFailResp(AuthResultVO authResult) { - Response resp = new Response<>(ErrorCode.PERMISSION_DENIED, null); + Response resp = new Response<>(ErrorCode.PERMISSION_DENIED + , new String[]{JobContextUtil.getUsername()}, null); resp.authResult = authResult; return resp; } diff --git a/src/backend/commons/esb-sdk/src/main/java/com/tencent/bk/job/common/esb/model/EsbResp.java b/src/backend/commons/esb-sdk/src/main/java/com/tencent/bk/job/common/esb/model/EsbResp.java index 59a7213a32..4893070877 100644 --- a/src/backend/commons/esb-sdk/src/main/java/com/tencent/bk/job/common/esb/model/EsbResp.java +++ b/src/backend/commons/esb-sdk/src/main/java/com/tencent/bk/job/common/esb/model/EsbResp.java @@ -101,7 +101,8 @@ public static EsbResp buildCommonFailResp(ServiceException e) { } public static EsbResp buildAuthFailResult(EsbApplyPermissionDTO permission) { - EsbResp esbResp = buildCommonFailResp(ErrorCode.BK_PERMISSION_DENIED, null, null); + EsbResp esbResp = buildCommonFailResp(ErrorCode.BK_PERMISSION_DENIED, + new String[]{JobContextUtil.getUsername()}, null); esbResp.setPermission(permission); return esbResp; }