refactor: show "row data" tab only when user is super admin

This commit is contained in:
yangsy
2025-09-05 17:47:25 +08:00
parent 3140539fa4
commit 2d0cbcab63
8 changed files with 32 additions and 8 deletions

View File

@@ -5,7 +5,7 @@ import { AesEncryption } from '@/utils/cipher';
import { getAppEnvConfig } from '@/utils/env';
import axios, { AxiosError } from 'axios';
import { defineStore } from 'pinia';
import { ref } from 'vue';
import { computed, ref } from 'vue';
import dayjs from 'dayjs';
import { useStationStore } from './station';
import { useQueryControlStore } from './query-control';
@@ -34,6 +34,8 @@ export const useUserStore = defineStore(
const userResourceList = ref<string[]>([]);
const lampLoginResultRecord = ref<Record<string, LoginResult> | null>(null);
const isSuperAdmin = computed(() => userInfo.value?.['id'] === '2');
const resetStore = () => {
userLoginResult.value = null;
userInfo.value = null;
@@ -145,6 +147,7 @@ export const useUserStore = defineStore(
return {
userLoginResult,
userInfo,
isSuperAdmin,
userResourceList,
lampLoginResultRecord,