Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

点击返回首页 #1682

Merged
merged 8 commits into from
May 8, 2024
13 changes: 12 additions & 1 deletion src/pages/src/views/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<template #side-header>
<div
style="display: flex; margin-right: 16px; text-decoration: none; align-items: center"
class="cursor-pointer"
@click="onGoBack"
>
<i class="user-icon icon-user-logo-i" />
<span class="title-desc">{{ $t('蓝鲸用户管理') }}</span>
Expand Down Expand Up @@ -149,7 +151,6 @@ const state = reactive({

const userStore = useUser();
const headerNav = ref([]);

const userInfo = computed(() => {
const { role } = userStore.user;
const baseNav = [
Expand Down Expand Up @@ -218,6 +219,16 @@ const toTenant = () => {
headerNav.value = [];
};

const onGoBack = () => {
const { role } = userStore.user;
if (role === 'super_manager' && route.name !== 'tenant') {
router.push({ name: 'tenant' });
headerNav.value = [];
} else if (role === 'tenant_manager' && route.name !== 'organization') {
router.push({ name: 'organization' });
} else if (role === 'natural_user') return;
};

// 产品文档
const docUrl = window.BK_USER_DOC_URL;

Expand Down