fix(frontend): handle clipboard fallback and markdown word export

This commit is contained in:
吉鑫升 committed 2026-07-03 16:54:16 +08:00
1 parent 195ef3ee40
commit db2f21191c
6 files changed
+86 -37

No files matched your search

@@ -29,6 +29,7 @@ import {
} from './GeneralQA.mock';
import { requestCrudService } from '@/service/request-axios-service';
import { authStorageGet } from '@/core/auth/scoped-storage';
import { copyTextToClipboard } from '@/core/clipboard';
/**
* 通用问答组件
@@ -1763,9 +1764,9 @@ const GeneralQA: React.FC<{
const handleCopyAssistantMessage = async (message: Message) => {
const answerText = getAssistantAnswerText(message);
try {
await navigator.clipboard.writeText(answerText);
} catch (copyError) {
console.error('复制模型回答失败:', copyError);
await copyTextToClipboard(answerText);
} catch {
// Keep the chat surface quiet when the browser blocks clipboard access.
}
};