refactor: show "row data" tab only when user is super admin
This commit is contained in:
@@ -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,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user