diff --git a/package.json b/package.json index ecf03dd2e22ae92186791d7de9530a772da12ffa..e8b8d1f0fcd6fec341ff71d176fdfcd45d380c27 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "@visactor/vchart": "^1.12.3", "@visactor/vchart-theme": "^1.12.1", "animate.css": "^4.1.1", - "axios": "^1.4.0", + "axios": "^1.6.8", "cesium": "1.99", "color": "^4.2.3", "crypto-js": "^4.1.1", diff --git a/src/api/axios.ts b/src/api/axios.ts index 7e74ac1a202fc241edd8a4ef6d43d66b8928c39c..e353d032bcaabe85ed7b0c04f6ccf158ffaf2b73 100644 --- a/src/api/axios.ts +++ b/src/api/axios.ts @@ -1,9 +1,9 @@ -import axios, { AxiosResponse, AxiosRequestConfig, Axios } from 'axios' +import axios, { AxiosResponse, AxiosRequestConfig, Axios,AxiosRequestHeaders,InternalAxiosRequestConfig } from 'axios' import { ResultEnum, ModuleTypeEnum } from "@/enums/httpEnum" import {PageEnum, ErrorPageNameMap, PreviewEnum} from "@/enums/pageEnum" import { StorageEnum } from '@/enums/storageEnum' import { axiosPre } from '@/settings/httpSetting' -import { SystemStoreEnum, SystemStoreUserInfoEnum } from '@/store/modules/systemStore/systemStore.d' +import { SystemStoreEnum, SystemStoreUserInfoEnum,UserInfoType } from '@/store/modules/systemStore/systemStore.d' import { redirectErrorPage, getLocalStorage, @@ -28,7 +28,9 @@ let base_url=`${import.meta.env.PROD ? import.meta.env.VITE_PRO_PATH : ''}${axio const dialog = useDialog() -export interface MyResponseType { + + +export interface MyResponseType extends AxiosResponse{ code: ResultEnum data: T message: string @@ -44,17 +46,14 @@ const axiosInstance = axios.create({ }) as unknown as MyRequestInstance axiosInstance.interceptors.request.use( - (config: AxiosRequestConfig) => { + (config:InternalAxiosRequestConfig) => { // 获取 tenantId const info = getLocalStorage(StorageEnum.GO_SYSTEM_STORE) // console.log(window.location) const tenantId = info ? info[SystemStoreEnum.TENANT_INFO]['tenantId'] : undefined - if (tenantId) { - config.headers = { - ...config.headers, - 'tenant-id': tenantId - } - } + + if (tenantId) (config as Recordable).headers['tenant-id'] = tenantId + // 白名单校验 if (includes(fetchAllowList, config.url)) return config @@ -64,11 +63,13 @@ axiosInstance.interceptors.request.use( routerTurnByName(PageEnum.BASE_LOGIN_NAME) return config } - const userInfo = info[SystemStoreEnum.USER_INFO] - config.headers = { - ...config.headers, - [userInfo[SystemStoreUserInfoEnum.TOKEN_NAME] || 'token']: 'Bearer ' + userInfo[SystemStoreUserInfoEnum.USER_TOKEN] || '' - } + const userInfo:UserInfoType = info[SystemStoreEnum.USER_INFO] as UserInfoType + + (config as Recordable).headers.Authorization = 'Bearer ' + userInfo[SystemStoreUserInfoEnum.USER_TOKEN] || '' + // config.headers = { + // ...config.headers, + // [userInfo[SystemStoreUserInfoEnum.TOKEN_NAME] || 'token']: 'Bearer ' + userInfo[SystemStoreUserInfoEnum.USER_TOKEN] || '' + // } return config }, (err: AxiosRequestConfig) => { @@ -123,12 +124,12 @@ axiosInstance.interceptors.response.use( }) //修改当前访问令牌 // config.headers!.Authorization = 'Bearer ' + (await refreshTokenRes).data.data.accessToken - const userInfo = info[SystemStoreEnum.USER_INFO] - config.headers = { - ...config.headers, - [userInfo[SystemStoreUserInfoEnum.TOKEN_NAME] || 'token']: 'Bearer ' + userInfo[SystemStoreUserInfoEnum.USER_TOKEN] || '' - } - + const userInfo:UserInfoType = info[SystemStoreEnum.USER_INFO] as UserInfoType + // config.headers = { + // ...config.headers, + // [userInfo[SystemStoreUserInfoEnum.TOKEN_NAME] || 'token']: 'Bearer ' + userInfo[SystemStoreUserInfoEnum.USER_TOKEN] || '' + // } + (config as Recordable).headers.Authorization = 'Bearer ' + userInfo[SystemStoreUserInfoEnum.USER_TOKEN] || '' requestList.forEach((cb: any) => { cb() }) diff --git a/src/components/Pages/ChartItemSetting/StylesSetting.vue b/src/components/Pages/ChartItemSetting/StylesSetting.vue index efb1d65369d963704138780b2a9dcf1cb11ab623..a226847c991387650b91be572b7d3101b42f9be7 100644 --- a/src/components/Pages/ChartItemSetting/StylesSetting.vue +++ b/src/components/Pages/ChartItemSetting/StylesSetting.vue @@ -182,7 +182,7 @@ const props = defineProps({ default: false }, chartStyles: { - type: Object as PropType, 'animations'>>, + type: Object as PropType, 'animations' | 'animationsOpen' | 'animationsCirculate' | 'animationsCurve' | 'animationsDirection' | 'circulatePlayTime' | 'circulateDelayTime'>>, required: true } }) diff --git a/src/packages/components/Charts/Lines/LineGradientSingle/index.vue b/src/packages/components/Charts/Lines/LineGradientSingle/index.vue index 5f9f2d6c7efda3a340edd0905ad9bd232a1308f0..e638ab8d308a56c3db46e2fba2a457cee7f86cf8 100644 --- a/src/packages/components/Charts/Lines/LineGradientSingle/index.vue +++ b/src/packages/components/Charts/Lines/LineGradientSingle/index.vue @@ -6,6 +6,7 @@ diff --git a/src/packages/components/Decorates/Mores/FlipperNumber/index.vue b/src/packages/components/Decorates/Mores/FlipperNumber/index.vue index e5369bbe81d38af1ef6ed4953a19a122158f9649..9d9f3c8cc547f3b6c7ef8a4e92ce6e31ba15141a 100644 --- a/src/packages/components/Decorates/Mores/FlipperNumber/index.vue +++ b/src/packages/components/Decorates/Mores/FlipperNumber/index.vue @@ -1,18 +1,18 @@ @@ -43,34 +43,35 @@ const { flipperRadius, flipperGap, flipperType, - flipperSpeed + flipperSpeed, + flipperBorderWidth } = toRefs(props.chartConfig.option as OptionType) const flipperData = ref([]) const getFlipperData = (val: string | number) => { return val - .toString() - .padStart(flipperLength.value, '0') // 左侧填充|右对齐 - .split('') // 转数组 - .slice(flipperLength.value * -1) // 从后面取指定长度 + .toString() + .padStart(flipperLength.value, '0') // 左侧填充|右对齐 + .split('') // 转数组 + .slice(flipperLength.value * -1) // 从后面取指定长度 } const updateDatasetHandler = (newVal: string | number) => { flipperData.value = getFlipperData(newVal) } watch( - () => props.chartConfig.option, - newVal => { - try { - updateDatasetHandler((newVal as OptionType).dataset) - } catch (error) { - console.log(error) + () => props.chartConfig.option, + newVal => { + try { + updateDatasetHandler((newVal as any as OptionType).dataset) + } catch (error) { + console.log(error) + } + }, + { + immediate: true, + deep: true } - }, - { - immediate: true, - deep: true - } ) useChartDataFetch(props.chartConfig, useChartEditStore, (newVal: string | number) => { diff --git a/src/packages/components/Informations/Texts/TextCard/index.vue b/src/packages/components/Informations/Texts/TextCard/index.vue index bd02533fef0cfeb9468110d5fe37887ea649212e..81eed18364efecc066ef34768cee3037031523a9 100644 --- a/src/packages/components/Informations/Texts/TextCard/index.vue +++ b/src/packages/components/Informations/Texts/TextCard/index.vue @@ -51,7 +51,7 @@