From 3c6726007c365938efe46ea98ad4ccb164daf311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cliuliaozhong=E2=80=9D?= <“liuliaozhong@canway.net”> Date: Wed, 28 Dec 2022 18:21:37 +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 ++-- .../main/java/com/tencent/bk/job/common/model/Response.java | 3 ++- .../java/com/tencent/bk/job/common/esb/model/EsbResp.java | 3 ++- src/backend/gradle.properties | 6 +++--- 8 files changed, 17 insertions(+), 15 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..d4bbd64e11 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..ba11c625ab 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=Insufficient user {0} permissions +9900403=Insufficient user {0} permissions 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..ba11c625ab 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=Insufficient user {0} permissions +9900403=Insufficient user {0} permissions 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..d4bbd64e11 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..d4bbd64e11 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/model/Response.java b/src/backend/commons/common/src/main/java/com/tencent/bk/job/common/model/Response.java index 3eebdf4d06..b0af4a4935 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..fac31e68ed 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; } diff --git a/src/backend/gradle.properties b/src/backend/gradle.properties index 2e9367317e..5b32487eb9 100644 --- a/src/backend/gradle.properties +++ b/src/backend/gradle.properties @@ -29,6 +29,6 @@ MAVEN_REPO_URL= MAVEN_REPO_DEPLOY_URL= MAVEN_REPO_USERNAME= MAVEN_REPO_PASSWORD= -DB_HOST= -DB_USERNAME= -DB_PASSWORD= +DB_HOST=127.0.0.1 +DB_USERNAME=root +DB_PASSWORD=root