Skip to content

Commit

Permalink
Merge pull request #2254 from hLinx/feature_app_permission
Browse files Browse the repository at this point in the history
feature: 蓝鲸统一登录改造——支持限制非腾讯用户访问方案 #2247
  • Loading branch information
hLinx authored Jul 20, 2023
2 parents e0cdf48 + e24c7dc commit 01c6463
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/frontend/src/common/bkmagic.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ export const permissionDialog = (authParams = {}, authResult = {}) => {
};

let systemPermissionInstance;
export const systemPermission = (message) => {
export const systemPermission = (message, data) => {
if (!systemPermissionInstance) {
systemPermissionInstance = new Vue({
i18n,
render: h => h(SystemPermission, { attrs: { message } }),
render: h => h(SystemPermission, { attrs: { message, data } }),
}).$mount();

systemPermissionInstance.$nextTick(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/src/utils/request/middleware/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export default (interceptors) => {
case 403: {
// 系统访问权限
if (error.response.data.code === 1247403) {
systemPermission(error.response.data.data);
systemPermission(error.response.data.errorMsg, error.response.data.data);
} else {
// 资源访问权限
const requestPayload = error.response.config.payload;
Expand Down
14 changes: 10 additions & 4 deletions src/frontend/src/views/system-permission.vue
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
<template>
<div class="system-permission">
<bk-exception type="403">
<span>{{ $t('无该应用的访问权限') }}</span>
<div class="text-subtitle">
<div style="font-size: 24px; line-height: 32px; color: #63656E;">
{{ message }}
</div>
<div class="text-subtitle">
{{ data }}
</div>
</bk-exception>
</div>
</template>
<script setup>
defineProps({
message: String,
data: String,
});
</script>
<style lang="postcss">
.system-permission{
display: flex;
height: 100vh;
padding-top: 150px;
justify-content: center;
padding-top: 200px;
background: #fff;
.text-subtitle{
margin-top: 14px;
margin-top: 16px;
font-size: 14px;
line-height: 22px;
color: #979ba5;
text-align: center;
}
Expand Down

0 comments on commit 01c6463

Please sign in to comment.