From 9f2482bf66229dada54dc115fa6393732e524a04 Mon Sep 17 00:00:00 2001 From: zxr <271055687@qq.com> Date: Fri, 3 Jul 2026 15:50:55 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A4=A7=E5=B1=8F=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/axios.config.ts | 4 ++-- src/api/fts.ts | 4 ++-- src/utils/router.ts | 17 +++++++++++++++-- src/views/chart/hooks/useSync.hook.ts | 3 ++- .../components/CreateModal/index.vue | 6 +++++- .../components/ProjectLayoutCreate/index.vue | 6 +++++- 6 files changed, 31 insertions(+), 9 deletions(-) diff --git a/src/api/axios.config.ts b/src/api/axios.config.ts index 658e5c9..8b95c27 100644 --- a/src/api/axios.config.ts +++ b/src/api/axios.config.ts @@ -17,5 +17,5 @@ export const fetchBlockList = [] // fts 接口列表(不添加 /Visual/v1 前缀) export const ftsList = [ - '/fts/v1/uploader' -] \ No newline at end of file + '/Assets/v1/fts/uploader' +] diff --git a/src/api/fts.ts b/src/api/fts.ts index 0ca24ef..4852ff6 100644 --- a/src/api/fts.ts +++ b/src/api/fts.ts @@ -11,7 +11,7 @@ const FtsUpload = (data: any, onUploadProgress?: (progress: number) => void) => const baseUrl = import.meta.env.PROD ? import.meta.env.VITE_PRO_PATH : import.meta.env.VITE_DEV_PATH return axiosInstance({ - url: `${baseUrl}/fts/v1/uploader`, + url: `${baseUrl}/Assets/v1/fts/uploader`, method: 'POST', data, headers: { @@ -26,4 +26,4 @@ const FtsUpload = (data: any, onUploadProgress?: (progress: number) => void) => }) } -export default FtsUpload \ No newline at end of file +export default FtsUpload diff --git a/src/utils/router.ts b/src/utils/router.ts index ca8a965..1401ac5 100644 --- a/src/utils/router.ts +++ b/src/utils/router.ts @@ -62,12 +62,25 @@ export const routerTurnByPath = ( path: string, query?: Array, isReplace?: boolean, - windowOpen?: boolean + windowOpen?: boolean, + queryParams?: Record ) => { let fullPath = '' if (query?.length) { fullPath = `${path}/${query.join('/')}` } + const searchParams = new URLSearchParams() + if (queryParams) { + Object.entries(queryParams).forEach(([key, value]) => { + if (value !== undefined && value !== '') { + searchParams.set(key, String(value)) + } + }) + } + const queryString = searchParams.toString() + if (queryString) { + fullPath = `${fullPath}${fullPath.includes('?') ? '&' : '?'}${queryString}` + } if (windowOpen) { return openNewWindow(fullPath) } @@ -243,4 +256,4 @@ export const getUrlQueryParams = (): Record => { } return params -} \ No newline at end of file +} diff --git a/src/views/chart/hooks/useSync.hook.ts b/src/views/chart/hooks/useSync.hook.ts index ba2f63a..5c5c8bf 100644 --- a/src/views/chart/hooks/useSync.hook.ts +++ b/src/views/chart/hooks/useSync.hook.ts @@ -256,7 +256,8 @@ export const useSync = () => { if (res.data) { updateStoreInfo(res.data) // 更新全局数据 - await updateComponent(JSONParse(res.data.content)) + const storageInfo = res.data.content ? JSONParse(res.data.content) : chartEditStore.getStorageInfo() + await updateComponent(storageInfo || chartEditStore.getStorageInfo()) return }else { chartEditStore.setProjectInfo(ProjectInfoEnum.PROJECT_ID, fetchRouteParamsLocation()) diff --git a/src/views/project/layout/components/ProjectLayoutCreate/components/CreateModal/index.vue b/src/views/project/layout/components/ProjectLayoutCreate/components/CreateModal/index.vue index 7e15c26..64e6646 100644 --- a/src/views/project/layout/components/ProjectLayoutCreate/components/CreateModal/index.vue +++ b/src/views/project/layout/components/ProjectLayoutCreate/components/CreateModal/index.vue @@ -41,10 +41,13 @@ import { PageEnum, ChartEnum } from '@/enums/pageEnum' import { ResultEnum } from '@/enums/httpEnum' import { fetchPathByName, routerTurnByPath, renderLang, getUUID } from '@/utils' import { createProjectApi } from '@/api/path' +import { useSystemStore } from '@/store/modules/systemStore/systemStore' +import { SystemStoreUserInfoEnum } from '@/store/modules/systemStore/systemStore.d' const { FishIcon, CloseIcon } = icon.ionicons5 const { StoreIcon, ObjectStorageIcon } = icon.carbon const showRef = ref(false) +const systemStore = useSystemStore() const emit = defineEmits(['close']) const props = defineProps({ @@ -101,7 +104,8 @@ const btnHandle = async (key: string) => { const { identity } = res.data const path = fetchPathByName(ChartEnum.CHART_HOME_NAME, 'href') - routerTurnByPath(path, [identity], undefined, true) + const token = systemStore.getUserInfo?.[SystemStoreUserInfoEnum.USER_TOKEN] + routerTurnByPath(path, [identity], undefined, true, { token }) closeHandle() } } catch (error) { diff --git a/src/views/project/layout/components/ProjectLayoutCreate/index.vue b/src/views/project/layout/components/ProjectLayoutCreate/index.vue index a980325..cbb42c2 100644 --- a/src/views/project/layout/components/ProjectLayoutCreate/index.vue +++ b/src/views/project/layout/components/ProjectLayoutCreate/index.vue @@ -35,9 +35,12 @@ import { ChartEnum } from '@/enums/pageEnum' import { fetchPathByName, routerTurnByPath, getUUID } from '@/utils' import { createProjectApi } from '@/api/path' import { ResultEnum } from '@/enums/httpEnum' +import { useSystemStore } from '@/store/modules/systemStore/systemStore' +import { SystemStoreUserInfoEnum } from '@/store/modules/systemStore/systemStore.d' const { DuplicateIcon, DuplicateOutlineIcon } = icon.ionicons5 const designStore = useDesignStore() +const systemStore = useSystemStore() const props = defineProps({ collapsed: Boolean @@ -58,7 +61,8 @@ const clickHandle = async () => { const { identity } = res.data || {} console.log('identity', identity) const path = fetchPathByName(ChartEnum.CHART_HOME_NAME, 'href') - routerTurnByPath(path, [identity], undefined, true) + const token = systemStore.getUserInfo?.[SystemStoreUserInfoEnum.USER_TOKEN] + routerTurnByPath(path, [identity], undefined, true, { token }) } else { window['$message'].error(window['$t']('project.create_failure')) }