diff --git a/yudao-ui-admin-vue3/src/config/axios/service.ts b/yudao-ui-admin-vue3/src/config/axios/service.ts index 52f5a8acd..2eff086f4 100644 --- a/yudao-ui-admin-vue3/src/config/axios/service.ts +++ b/yudao-ui-admin-vue3/src/config/axios/service.ts @@ -46,7 +46,7 @@ service.interceptors.request.use( ;(config as Recordable).headers.Authorization = 'Bearer ' + getAccessToken() // 让每个请求携带自定义token } // 设置租户 - if (tenantEnable) { + if (tenantEnable && tenantEnable === 'true') { const tenantId = getTenantId() if (tenantId) service.defaults.headers.common['tenant-id'] = tenantId } diff --git a/yudao-ui-admin-vue3/src/hooks/web/useCache.ts b/yudao-ui-admin-vue3/src/hooks/web/useCache.ts index b405ef3cd..97a7df68a 100644 --- a/yudao-ui-admin-vue3/src/hooks/web/useCache.ts +++ b/yudao-ui-admin-vue3/src/hooks/web/useCache.ts @@ -4,9 +4,9 @@ import WebStorageCache from 'web-storage-cache' -type CacheType = 'sessionStorage' | 'localStorage' +type CacheType = 'localStorage' | 'sessionStorage' -export const useCache = (type: CacheType = 'sessionStorage') => { +export const useCache = (type: CacheType = 'localStorage') => { const wsCache: WebStorageCache = new WebStorageCache({ storage: type }) diff --git a/yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts b/yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts index 04b0df0b8..e27ed52be 100644 --- a/yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts +++ b/yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts @@ -1,5 +1,5 @@ import { computed, reactive } from 'vue' -import { VxeGridProps } from 'vxe-table' +import { SizeType, VxeGridProps } from 'vxe-table' import { useAppStore } from '@/store/modules/app' import { VxeAllSchemas } from './useVxeCrudSchemas' import { useI18n } from '@/hooks/web/useI18n' @@ -18,19 +18,26 @@ interface UseVxeGridConfig { const appStore = useAppStore() const currentSize = computed(() => { - if (appStore.getCurrentSize === 'small') { - return 'small' - } else if (appStore.getCurrentSize === 'large') { - return 'mini' - } else { - return 'medium' + let resSize: SizeType = 'small' + const appsize = appStore.getCurrentSize + switch (appsize) { + case 'large': + resSize = 'medium' + break + case 'default': + resSize = 'small' + break + case 'small': + resSize = 'mini' + break } + return resSize }) export const useVxeGrid = (config?: UseVxeGridConfig) => { const gridOptions = reactive({ loading: true, - size: currentSize.value, + size: currentSize as any, height: 800, rowConfig: { isCurrent: true, // 当鼠标点击行时,是否要高亮当前行