From 2283f707977c2a9224216ba3ce61b1f163c0834a Mon Sep 17 00:00:00 2001 From: hLinx <327159425@qq.com> Date: Wed, 19 Jul 2023 16:47:19 +0800 Subject: [PATCH 1/9] =?UTF-8?q?feature:=20=E8=93=9D=E9=B2=B8=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E7=99=BB=E5=BD=95=E6=94=B9=E9=80=A0=E2=80=94=E2=80=94?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=99=90=E5=88=B6=E9=9D=9E=E8=85=BE=E8=AE=AF?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=AE=BF=E9=97=AE=E6=96=B9=E6=A1=88=20#2247?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/src/common/bkmagic.js | 14 +++++++++ .../src/utils/request/middleware/response.js | 26 ++++++++++------ src/frontend/src/views/system-permission.vue | 30 +++++++++++++++++++ 3 files changed, 61 insertions(+), 9 deletions(-) create mode 100644 src/frontend/src/views/system-permission.vue diff --git a/src/frontend/src/common/bkmagic.js b/src/frontend/src/common/bkmagic.js index b038dcd7d6..f63dcac5aa 100644 --- a/src/frontend/src/common/bkmagic.js +++ b/src/frontend/src/common/bkmagic.js @@ -29,6 +29,8 @@ import { parseURL, } from '@utils/assist'; +import SystemPermission from '@views/system-permission.vue'; + import ApplyPermissionDialog from '@components/apply-permission/apply-dialog'; import PassLogin from '@blueking/paas-login'; @@ -138,6 +140,18 @@ export const permissionDialog = (authParams = {}, authResult = {}) => { }); }; +let systemPermissionInstance; +export const systemPermission = (message) => { + if (!systemPermissionInstance) { + systemPermissionInstance = new Vue(SystemPermission).$mount(); + systemPermissionInstance.message = message; + console.dir(systemPermissionInstance.$el); + systemPermissionInstance.$nextTick(() => { + document.body.innerHTML = systemPermissionInstance.$el.outerHTML; + }); + } +}; + Vue.prototype.messageError = messageError; Vue.prototype.messageSuccess = messageSuccess; Vue.prototype.messageInfo = messageInfo; diff --git a/src/frontend/src/utils/request/middleware/response.js b/src/frontend/src/utils/request/middleware/response.js index 18f5cc08d1..3495c018fb 100644 --- a/src/frontend/src/utils/request/middleware/response.js +++ b/src/frontend/src/utils/request/middleware/response.js @@ -31,6 +31,7 @@ import { loginDialog, messageError, permissionDialog, + systemPermission, } from '@/common/bkmagic'; import RequestError from '../lib/request-error'; @@ -67,7 +68,7 @@ export default (interceptors) => { if (error.response) { // 登录状态失效 if (error.response.status === 401 - && error.response.headers['x-login-url']) { + && error.response.headers['x-login-url']) { return Promise.reject(new RequestError(401, error.response.headers['x-login-url'])); } // 默认使用 http 错误描述, @@ -98,19 +99,26 @@ export default (interceptors) => { break; // 没权限 case 403: { - const requestPayload = error.response.config.payload; - const authResult = new AuthResultModel(error.response.data.authResult || {}); + // 系统访问权限 + if (error.response.data.code === 1302403) { + systemPermission(error.response.data.data); + } else { + // 资源访问权限 + const requestPayload = error.response.config.payload; + const authResult = new AuthResultModel(error.response.data.authResult || {}); - if (requestPayload.permission === 'page') { + if (requestPayload.permission === 'page') { // 配合 jb-router-view(@components/jb-router-view)全局展示没权限提示 - EventBus.$emit('permission-page', authResult); - } else if (requestPayload.permission === 'catch') { + EventBus.$emit('permission-page', authResult); + } else if (requestPayload.permission === 'catch') { // 配合 apply-section (@components/apply-permission/apply-section)使用,局部展示没权限提示 - EventBus.$emit('permission-catch', authResult); - } else { + EventBus.$emit('permission-catch', authResult); + } else { // 弹框展示没权限提示 - permissionDialog('', authResult); + permissionDialog('', authResult); + } } + break; } case 'CANCEL': diff --git a/src/frontend/src/views/system-permission.vue b/src/frontend/src/views/system-permission.vue new file mode 100644 index 0000000000..96e611fc73 --- /dev/null +++ b/src/frontend/src/views/system-permission.vue @@ -0,0 +1,30 @@ + + + + 无该应用的访问权限 + + 请联系 {{ message }} 开通 + + + + + + + From 8ef17888a62322e139f0050c152f3fc788c4816c Mon Sep 17 00:00:00 2001 From: jsonwan Date: Wed, 19 Jul 2023 16:48:48 +0800 Subject: [PATCH 2/9] =?UTF-8?q?feature:=20=E6=94=AF=E6=8C=81=E8=93=9D?= =?UTF-8?q?=E9=B2=B8=E5=BA=94=E7=94=A8=E7=BA=A7=E5=88=AB=E7=9A=84=E6=9D=83?= =?UTF-8?q?=E9=99=90=E6=8E=A7=E5=88=B6=E8=B7=B3=E8=BD=AC=20#2238?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../i18n/exception/message.properties | 1 + .../i18n/exception/message_en.properties | 1 + .../i18n/exception/message_en_US.properties | 1 + .../i18n/exception/message_zh.properties | 1 + .../i18n/exception/message_zh_CN.properties | 1 + .../bk/job/common/constant/ErrorCode.java | 2 + .../tencent/bk/job/common/model/Response.java | 2 +- .../common/esb/sdk/AbstractEsbSdkClient.java | 8 +++ .../AppPermissionDeniedException.java | 51 +++++++++++++++++++ .../job/common/paas/login/EELoginClient.java | 28 +++++++++- .../web/AuthorizeGatewayFilterFactory.java | 40 ++++++++++++--- 11 files changed, 127 insertions(+), 9 deletions(-) create mode 100644 src/backend/commons/paas-sdk/src/main/java/com/tencent/bk/job/common/paas/exception/AppPermissionDeniedException.java 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 cdda51fd51..fc398b3245 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 @@ -216,6 +216,7 @@ ##业务错误-用户服务、登录服务 1247001=用户不存在或者未登录 +1247403=无该应用访问权限 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 a63ebdb2e7..797de2d341 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 @@ -216,6 +216,7 @@ ## Business error - User/Login 1247001=User does not exist or is not logged in +1247403=Do not have access permission for the current application ## Business error - Backup 1249001=Fail to get node info from artifactory 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 a63ebdb2e7..797de2d341 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 @@ -216,6 +216,7 @@ ## Business error - User/Login 1247001=User does not exist or is not logged in +1247403=Do not have access permission for the current application ## Business error - Backup 1249001=Fail to get node info from artifactory 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 cdda51fd51..fc398b3245 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 @@ -216,6 +216,7 @@ ##业务错误-用户服务、登录服务 1247001=用户不存在或者未登录 +1247403=无该应用访问权限 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 cdda51fd51..fc398b3245 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 @@ -216,6 +216,7 @@ ##业务错误-用户服务、登录服务 1247001=用户不存在或者未登录 +1247403=无该应用访问权限 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 0f24a926b6..309a397bc4 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 @@ -273,6 +273,8 @@ public class ErrorCode { // 用户服务 start // 用户不存在或者未登录 public static final int USER_NOT_EXIST_OR_NOT_LOGIN_IN = 1247001; + // 用户认证成功,但用户无应用访问权限 + public static final int USER_ACCESS_APP_FORBIDDEN = 1247403; // 用户服务 end // 业务网关 start 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 fae8eed059..e41359abd2 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 @@ -58,7 +58,7 @@ public class Response { @ApiModelProperty("错误信息") private String errorMsg; - @ApiModelProperty("请求成功返回的数据") + @ApiModelProperty("请求成功/失败返回的数据") private T data; @ApiModelProperty("请求 ID") diff --git a/src/backend/commons/esb-sdk/src/main/java/com/tencent/bk/job/common/esb/sdk/AbstractEsbSdkClient.java b/src/backend/commons/esb-sdk/src/main/java/com/tencent/bk/job/common/esb/sdk/AbstractEsbSdkClient.java index cf1c6c6a00..d960721b41 100644 --- a/src/backend/commons/esb-sdk/src/main/java/com/tencent/bk/job/common/esb/sdk/AbstractEsbSdkClient.java +++ b/src/backend/commons/esb-sdk/src/main/java/com/tencent/bk/job/common/esb/sdk/AbstractEsbSdkClient.java @@ -48,6 +48,10 @@ * ESB API 调用基础实现 */ public abstract class AbstractEsbSdkClient { + + // 请求成功 + protected static final Integer ESB_CODE_OK = 0; + private final Logger log = LoggerFactory.getLogger(this.getClass()); private static final JsonMapper JSON_MAPPER = JsonMapper.nonDefaultMapper(); @@ -150,6 +154,10 @@ private void requestEsbApi(BkApiContext extends EsbReq, R> apiContext, } esbResp = JSON_MAPPER.fromJson(respStr, typeReference); + if (esbResp == null) { + log.warn("[AbstractEsbSdkClient] warn:esbResp is null after JSON parse, respStr={}", respStr); + throw new InternalException("Esb api resp unexpected, fail to parse json data", ErrorCode.API_ERROR); + } apiContext.setResp(esbResp); if (!esbResp.getResult()) { log.warn( diff --git a/src/backend/commons/paas-sdk/src/main/java/com/tencent/bk/job/common/paas/exception/AppPermissionDeniedException.java b/src/backend/commons/paas-sdk/src/main/java/com/tencent/bk/job/common/paas/exception/AppPermissionDeniedException.java new file mode 100644 index 0000000000..ba74d68d28 --- /dev/null +++ b/src/backend/commons/paas-sdk/src/main/java/com/tencent/bk/job/common/paas/exception/AppPermissionDeniedException.java @@ -0,0 +1,51 @@ +/* + * Tencent is pleased to support the open source community by making BK-JOB蓝鲸智云作业平台 available. + * + * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. + * + * BK-JOB蓝鲸智云作业平台 is licensed under the MIT License. + * + * License for BK-JOB蓝鲸智云作业平台: + * -------------------------------------------------------------------- + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated + * documentation files (the "Software"), to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and + * to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of + * the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO + * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +package com.tencent.bk.job.common.paas.exception; + +import com.tencent.bk.job.common.constant.ErrorCode; +import com.tencent.bk.job.common.exception.ServiceException; +import com.tencent.bk.job.common.model.error.ErrorType; +import lombok.Getter; +import lombok.ToString; + +/** + * 应用权限不足异常 + */ +@Getter +@ToString +public class AppPermissionDeniedException extends ServiceException { + + // 源于用户管理接口:进一步的操作提示 + private final String message; + + public AppPermissionDeniedException(String message) { + super(ErrorType.PERMISSION_DENIED, ErrorCode.USER_ACCESS_APP_FORBIDDEN); + this.message = message; + } + + public String getMessage() { + return message; + } +} diff --git a/src/backend/commons/paas-sdk/src/main/java/com/tencent/bk/job/common/paas/login/EELoginClient.java b/src/backend/commons/paas-sdk/src/main/java/com/tencent/bk/job/common/paas/login/EELoginClient.java index 4c55d2f528..f7e6979fd3 100644 --- a/src/backend/commons/paas-sdk/src/main/java/com/tencent/bk/job/common/paas/login/EELoginClient.java +++ b/src/backend/commons/paas-sdk/src/main/java/com/tencent/bk/job/common/paas/login/EELoginClient.java @@ -32,6 +32,7 @@ import com.tencent.bk.job.common.exception.InternalUserManageException; import com.tencent.bk.job.common.metrics.CommonMetricNames; import com.tencent.bk.job.common.model.dto.BkUserDTO; +import com.tencent.bk.job.common.paas.exception.AppPermissionDeniedException; import com.tencent.bk.job.common.paas.model.EsbUserDto; import com.tencent.bk.job.common.util.http.HttpMetricUtil; import io.micrometer.core.instrument.Tag; @@ -40,6 +41,14 @@ @Slf4j public class EELoginClient extends AbstractEsbSdkClient implements ILoginClient { + + // 用户认证失败,即用户登录态无效 + private static final Integer ESB_CODE_USER_NOT_LOGIN = 1302100; + // 用户不存在 + private static final Integer ESB_CODE_USER_NOT_EXIST = 1302103; + // 用户认证成功,但用户无应用访问权限 + private static final Integer ESB_CODE_USER_NO_APP_PERMISSION = 1302403; + private static final String API_GET_USER_INFO = "/api/c/compapi/v2/bk_login/get_user/"; public EELoginClient(String esbHostUrl, String appCode, String appSecret, String lang, boolean useEsbTestEnv) { @@ -81,7 +90,13 @@ private BkUserDTO getUserInfo(EsbReq esbReq) { new TypeReference>() { } ); - return convertToBkUserDTO(esbResp.getData()); + Integer code = esbResp.getCode(); + if (ESB_CODE_OK.equals(code)) { + return convertToBkUserDTO(esbResp.getData()); + } else { + handleNotOkResp(esbResp); + return null; + } } catch (Exception e) { String errorMsg = "Get " + API_GET_USER_INFO + " error"; log.error(errorMsg, e); @@ -91,6 +106,17 @@ private BkUserDTO getUserInfo(EsbReq esbReq) { } } + private void handleNotOkResp(EsbResp esbResp) { + Integer code = esbResp.getCode(); + if (ESB_CODE_USER_NO_APP_PERMISSION.equals(code)) { + throw new AppPermissionDeniedException(esbResp.getMessage()); + } else if (ESB_CODE_USER_NOT_LOGIN.equals(code)) { + log.info("User not login, esbResp.code={}, esbResp.message={}", esbResp.getCode(), esbResp.getMessage()); + } else if (ESB_CODE_USER_NOT_EXIST.equals(code)) { + log.info("User not exist, esbResp.code={}, esbResp.message={}", esbResp.getCode(), esbResp.getMessage()); + } + } + private BkUserDTO convertToBkUserDTO(EsbUserDto esbUserDto) { BkUserDTO bkUserDTO = new BkUserDTO(); bkUserDTO.setUsername(esbUserDto.getUsername()); diff --git a/src/backend/job-gateway/src/main/java/com/tencent/bk/job/gateway/filter/web/AuthorizeGatewayFilterFactory.java b/src/backend/job-gateway/src/main/java/com/tencent/bk/job/gateway/filter/web/AuthorizeGatewayFilterFactory.java index faf7edff43..d788830aab 100644 --- a/src/backend/job-gateway/src/main/java/com/tencent/bk/job/gateway/filter/web/AuthorizeGatewayFilterFactory.java +++ b/src/backend/job-gateway/src/main/java/com/tencent/bk/job/gateway/filter/web/AuthorizeGatewayFilterFactory.java @@ -24,8 +24,12 @@ package com.tencent.bk.job.gateway.filter.web; +import com.tencent.bk.job.common.constant.ErrorCode; +import com.tencent.bk.job.common.model.Response; import com.tencent.bk.job.common.model.dto.BkUserDTO; +import com.tencent.bk.job.common.paas.exception.AppPermissionDeniedException; import com.tencent.bk.job.common.util.RequestUtil; +import com.tencent.bk.job.common.util.json.JsonUtils; import com.tencent.bk.job.gateway.config.LoginExemptionConfig; import com.tencent.bk.job.gateway.web.service.LoginService; import lombok.extern.slf4j.Slf4j; @@ -33,12 +37,15 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cloud.gateway.filter.GatewayFilter; import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory; +import org.springframework.core.io.buffer.DataBuffer; import org.springframework.http.HttpStatus; import org.springframework.http.server.reactive.ServerHttpRequest; import org.springframework.http.server.reactive.ServerHttpResponse; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; +import reactor.core.publisher.Mono; +import java.nio.charset.StandardCharsets; import java.util.List; /** @@ -87,13 +94,11 @@ private GatewayFilter getLoginFilter() { response.getHeaders().add("x-login-url", loginService.getLoginRedirectUrl()); return response.setComplete(); } - BkUserDTO user = null; - // 遍历所有传入token找出当前环境的 - for (String bkToken : bkTokenList) { - user = loginService.getUser(bkToken); - if (user != null) { - break; - } + BkUserDTO user; + try { + user = getUserByTokenList(bkTokenList); + } catch (AppPermissionDeniedException e) { + return getUserAccessAppForbiddenResp(response, e.getMessage()); } if (user == null) { log.warn("Invalid user token"); @@ -108,6 +113,27 @@ private GatewayFilter getLoginFilter() { }; } + private Mono getUserAccessAppForbiddenResp(ServerHttpResponse response, String data) { + Response> resp = new Response<>(ErrorCode.USER_ACCESS_APP_FORBIDDEN, data); + response.setStatusCode(HttpStatus.FORBIDDEN); + String body = JsonUtils.toJson(resp); + DataBuffer dataBuffer = response.bufferFactory().wrap(body.getBytes(StandardCharsets.UTF_8)); + response.getHeaders().setContentLength(body.length()); + response.writeWith(Mono.just(dataBuffer)).subscribe(); + return response.setComplete(); + } + + private BkUserDTO getUserByTokenList(List bkTokenList) { + // 遍历所有传入token找出当前环境的 + for (String bkToken : bkTokenList) { + BkUserDTO user = loginService.getUser(bkToken); + if (user != null) { + return user; + } + } + return null; + } + @Override public GatewayFilter apply(Config config) { if (loginExemptionConfig.isEnableLoginExemption()) { From c3aed86054f8c49f42e86861c9046134d61c3151 Mon Sep 17 00:00:00 2001 From: hLinx <327159425@qq.com> Date: Thu, 20 Jul 2023 10:23:53 +0800 Subject: [PATCH 3/9] =?UTF-8?q?feature:=20=E8=93=9D=E9=B2=B8=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E7=99=BB=E5=BD=95=E6=94=B9=E9=80=A0=E2=80=94=E2=80=94?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=99=90=E5=88=B6=E9=9D=9E=E8=85=BE=E8=AE=AF?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=AE=BF=E9=97=AE=E6=96=B9=E6=A1=88=20#2247?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/src/common/bkmagic.js | 10 +++++++--- src/frontend/src/i18n/local.js | 1 + src/frontend/src/utils/request/middleware/response.js | 2 +- src/frontend/src/views/system-permission.vue | 8 ++++++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/frontend/src/common/bkmagic.js b/src/frontend/src/common/bkmagic.js index f63dcac5aa..c07ed472da 100644 --- a/src/frontend/src/common/bkmagic.js +++ b/src/frontend/src/common/bkmagic.js @@ -35,6 +35,8 @@ import ApplyPermissionDialog from '@components/apply-permission/apply-dialog'; import PassLogin from '@blueking/paas-login'; +import i18n from '@/i18n'; + // 全量引入 import './fully-import'; @@ -143,9 +145,11 @@ export const permissionDialog = (authParams = {}, authResult = {}) => { let systemPermissionInstance; export const systemPermission = (message) => { if (!systemPermissionInstance) { - systemPermissionInstance = new Vue(SystemPermission).$mount(); - systemPermissionInstance.message = message; - console.dir(systemPermissionInstance.$el); + systemPermissionInstance = new Vue({ + i18n, + render: h => h(SystemPermission, { attrs: { message } }), + }).$mount(); + systemPermissionInstance.$nextTick(() => { document.body.innerHTML = systemPermissionInstance.$el.outerHTML; }); diff --git a/src/frontend/src/i18n/local.js b/src/frontend/src/i18n/local.js index 55c150c794..3e0e1fd91e 100644 --- a/src/frontend/src/i18n/local.js +++ b/src/frontend/src/i18n/local.js @@ -594,4 +594,5 @@ export default { 取消收藏成功: 'Remove from my-favorite-list successful', '复制 IP': 'Copy IP', '复制 IPv6': 'Copy IPv6', + 无该应用的访问权限: 'Do not have access permission for the current application.', }; diff --git a/src/frontend/src/utils/request/middleware/response.js b/src/frontend/src/utils/request/middleware/response.js index 3495c018fb..d5bc1ce183 100644 --- a/src/frontend/src/utils/request/middleware/response.js +++ b/src/frontend/src/utils/request/middleware/response.js @@ -100,7 +100,7 @@ export default (interceptors) => { // 没权限 case 403: { // 系统访问权限 - if (error.response.data.code === 1302403) { + if (error.response.data.code === 1247403) { systemPermission(error.response.data.data); } else { // 资源访问权限 diff --git a/src/frontend/src/views/system-permission.vue b/src/frontend/src/views/system-permission.vue index 96e611fc73..440ba1bceb 100644 --- a/src/frontend/src/views/system-permission.vue +++ b/src/frontend/src/views/system-permission.vue @@ -1,17 +1,21 @@ - 无该应用的访问权限 + {{ $t('无该应用的访问权限') }} - 请联系 {{ message }} 开通 + {{ message }}