From 0226c7df3d50bf895c09e195f0695a9a7bc20816 Mon Sep 17 00:00:00 2001 From: Ethan-Zhang Date: Mon, 29 Sep 2025 12:20:16 +0800 Subject: [PATCH] Fix: wtd prefix api route bugfix --- src/apis/paths/document.ts | 4 +--- src/utils/tools.ts | 13 ------------- src/views/dialogue/components/DialogueSession.vue | 3 +-- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/src/apis/paths/document.ts b/src/apis/paths/document.ts index 1bfeced0..db220307 100644 --- a/src/apis/paths/document.ts +++ b/src/apis/paths/document.ts @@ -9,15 +9,13 @@ // See the Mulan PSL v2 for more details. import { witchainDGet } from 'src/apis/server'; import type { FcResponse } from 'src/apis/server'; -import { getWitchainDAPIPrefix } from 'src/utils/tools'; /** * 获取文档解析方法列表 * @returns Promise<[any, FcResponse | undefined]> */ export const getParseMethodList = (): Promise<[any, FcResponse | undefined]> => { - const apiPrefix = getWitchainDAPIPrefix(); - return witchainDGet(`${apiPrefix}/other/parse_method`); + return witchainDGet(`/wtd/other/parse_method`); }; /** diff --git a/src/utils/tools.ts b/src/utils/tools.ts index d27aa992..063cfc43 100644 --- a/src/utils/tools.ts +++ b/src/utils/tools.ts @@ -155,16 +155,3 @@ export async function getWitchainDProxyUrl(): Promise { const witchainDUrl = import.meta.env.WITCHAIND_PROXY_URL; return typeof witchainDUrl === 'string' && witchainDUrl ? witchainDUrl : ''; } - -/** - * 获取 WitchainD API 路径前缀 - * 根据环境返回正确的API路径前缀 - * - 开发环境:/witchaind/api - * - 生产环境:/wtd/api - */ -export function getWitchainDAPIPrefix(): string { - // 开发环境使用 /witchaind/api,生产环境使用 /wtd/api - const isDevelopment = window.location.hostname === 'localhost' || - import.meta.env.MODE === 'development'; - return isDevelopment ? '/witchaind/api' : '/wtd/api'; -} diff --git a/src/views/dialogue/components/DialogueSession.vue b/src/views/dialogue/components/DialogueSession.vue index ae007a01..a2732910 100644 --- a/src/views/dialogue/components/DialogueSession.vue +++ b/src/views/dialogue/components/DialogueSession.vue @@ -902,8 +902,7 @@ const downLoadSourceFile = (file: any) => { // 根据环境动态获取API前缀 const isDevelopment = window.location.hostname === 'localhost' || import.meta.env.MODE === 'development'; - const apiPrefix = isDevelopment ? '/witchaind/api' : '/wtd/api'; - const url = `${window.origin}${apiPrefix}/doc/download?docId=${file.documentId}`; + const url = `${window.origin}/wtd/doc/download?docId=${file.documentId}`; downloadFun(url); }; -- Gitee