Skip to content

Commit

Permalink
--story=121670270 【前端框架】API层需要支持新版无权限数据 (merge request !2205)
Browse files Browse the repository at this point in the history
  • Loading branch information
hitozhang authored and wessonli committed Jan 17, 2025
1 parent 5bffb38 commit cd164c2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bcs-ui/frontend/src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,12 @@ function handleReject(error, config) {
} if (status === 500) {
message = window.i18n.t('generic.msg.error.system');
} else if (status === 403) {
message = window.i18n.t('generic.msg.warning.403');
// 兼容新版无权限数据结构
if (data?.error?.code === 'IAM_NO_PERMISSION') {
bus.$emit('show-apply-perm-modal', { perms: data?.error?.data });
} else {
message = window.i18n.t('generic.msg.warning.403');
}
} else if ([4005, 40300].includes(data?.code)) {
bus.$emit('show-apply-perm-modal', data?.data);
} else if (data?.code === 40403) {
Expand Down

0 comments on commit cd164c2

Please sign in to comment.