feat(i18n): 将前端用户可见中文硬编码改为四语言
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
dce915ea30
commit
ac7b53a523
105 files changed
+2928
-647
No files matched your search
@@ -1,10 +1,11 @@
|
||||
/**
|
||||
* features/chat/utils/fileCheckExcelDownload.ts
|
||||
* 用途:解析文件检核 Excel 下载链接,并通过 Workspace 会话鉴权下载(不依赖短期 JWT)。
|
||||
* 依赖:getAuthHeaders。
|
||||
* 依赖:getAuthHeaders、vue-i18n。
|
||||
* 逻辑:ChatMessageBubble 点击 Dify 返回的 Tool API 链接时,改走 workspace 下载接口以支持历史对话。
|
||||
*/
|
||||
|
||||
import i18n from '@/i18n';
|
||||
import { getAuthHeaders } from '@/shared/utils/auth';
|
||||
|
||||
const FILE_CHECK_TOOL_EXCEL_PATH_RE = /\/api\/file-check\/tools\/runs\/(\d+)\/excel(?:\?.*)?$/i;
|
||||
@@ -71,6 +72,7 @@ const parseDownloadFilename = (disposition: string | null, fallback: string) =>
|
||||
|
||||
/**
|
||||
* 通过 Workspace 接口下载检核 Excel(使用登录态,不依赖 Tool API 短期 token)。
|
||||
* 核心逻辑:fetch blob;失败优先用后端 message,否则 chat.toolRun.downloadFailedStatus。
|
||||
* @param runId - 检核批次 ID。
|
||||
* @param fallbackName - 默认文件名。
|
||||
*/
|
||||
@@ -86,7 +88,7 @@ export async function downloadFileCheckExcelByRunId(
|
||||
? body.message
|
||||
: typeof body?.error?.message === 'string'
|
||||
? body.error.message
|
||||
: `下载失败:${res.status}`;
|
||||
: String(i18n.global.t('chat.toolRun.downloadFailedStatus', { status: res.status }));
|
||||
throw new Error(message);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user