Skip to content

Commit

Permalink
fix(系统设置): 过期用户点击其他组织的进入项目跳转到无资源页面&样式调整
Browse files Browse the repository at this point in the history
  • Loading branch information
1myuan authored and liuruibin committed May 23, 2024
1 parent f18901a commit 56f3a7b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
12 changes: 10 additions & 2 deletions frontend/src/views/setting/organization/project/orgProject.vue
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,15 @@
);
const keyword = ref('');
const operationWidth = computed(() => {
if (hasOperationPermission.value) {
return 250;
}
if (hasAnyPermission(['PROJECT_BASE_INFO:READ'])) {
return 100;
}
return 50;
});
const organizationColumns: MsTableColumn = [
{
title: 'system.organization.ID',
Expand Down Expand Up @@ -210,7 +218,7 @@
slotName: 'operation',
dataIndex: 'operation',
fixed: 'right',
width: hasOperationPermission.value ? 250 : 50,
width: operationWidth.value,
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,15 @@
'SYSTEM_ORGANIZATION_PROJECT:READ+DELETE',
])
);
const operationWidth = computed(() => {
if (hasOperationPermission.value) {
return 250;
}
if (hasAnyPermission(['PROJECT_BASE_INFO:READ'])) {
return 100;
}
return 50;
});
const organizationColumns: MsTableColumn = [
{
title: 'system.organization.ID',
Expand Down Expand Up @@ -189,7 +197,7 @@
slotName: 'operation',
dataIndex: 'operation',
fixed: 'right',
width: hasOperationPermission.value ? 250 : 50,
width: operationWidth.value,
},
];
Expand Down
10 changes: 9 additions & 1 deletion frontend/src/views/setting/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,27 @@ import router from '@/router';
import { NO_PROJECT_ROUTE_NAME } from '@/router/constants';
import { useUserStore } from '@/store';
import useAppStore from '@/store/modules/app';
import useLicenseStore from '@/store/modules/setting/license';
import { hasAnyPermission } from '@/utils/permission';

import { ProjectManagementRouteEnum } from '@/enums/routeEnum';

const { t } = useI18n();
const userStore = useUserStore();
const appStore = useAppStore();
const licenseStore = useLicenseStore();

export async function enterProject(projectId: string, organizationId?: string) {
try {
appStore.showLoading();
// 切换组织
if (organizationId) {
if (organizationId && appStore.currentOrgId !== organizationId) {
if (!licenseStore.hasLicense()) {
router.push({
name: NO_PROJECT_ROUTE_NAME,
});
return;
}
await switchUserOrg(organizationId, userStore.id || '');
}
await userStore.isLogin(true);
Expand Down

0 comments on commit 56f3a7b

Please sign in to comment.