fix(个人中心): 修复useClipboard问题

This commit is contained in:
WangXu10 2024-03-29 18:50:09 +08:00 committed by Craftsman
parent 4cdcae4413
commit f1215eba88
9 changed files with 19 additions and 19 deletions

View File

@ -216,10 +216,10 @@
} }
} }
const { copy, isSupported } = useClipboard(); const { copy, isSupported } = useClipboard({ legacy: true });
async function copyVersion() { function copyVersion() {
if (isSupported) { if (isSupported) {
await copy(appStore.version); copy(appStore.version);
Message.success(t('common.copySuccess')); Message.success(t('common.copySuccess'));
} else { } else {
Message.warning(t('common.copyNotSupport')); Message.warning(t('common.copyNotSupport'));

View File

@ -581,11 +581,11 @@ if (!result){
AssertionResult.setFailureMessage(msg); AssertionResult.setFailureMessage(msg);
AssertionResult.setFailure(true); AssertionResult.setFailure(true);
}`); }`);
const { copy, isSupported } = useClipboard(); const { copy, isSupported } = useClipboard({ legacy: true });
async function copyScriptEx() { function copyScriptEx() {
if (isSupported) { if (isSupported) {
await copy(scriptEx.value); copy(scriptEx.value);
Message.success(t('apiTestDebug.scriptExCopySuccess')); Message.success(t('apiTestDebug.scriptExCopySuccess'));
} else { } else {
Message.warning(t('apiTestDebug.copyNotSupport')); Message.warning(t('apiTestDebug.copyNotSupport'));

View File

@ -111,11 +111,11 @@
default: ResponseComposition.BODY, default: ResponseComposition.BODY,
}); });
const { copy, isSupported } = useClipboard(); const { copy, isSupported } = useClipboard({ legacy: true });
async function copyScript() { function copyScript() {
if (isSupported) { if (isSupported) {
await copy(props.requestResult?.responseResult.body || ''); copy(props.requestResult?.responseResult.body || '');
Message.success(t('common.copySuccess')); Message.success(t('common.copySuccess'));
} else { } else {
Message.warning(t('apiTestDebug.copyNotSupport')); Message.warning(t('apiTestDebug.copyNotSupport'));

View File

@ -91,10 +91,10 @@
expandIds.value.push(value); expandIds.value.push(value);
} }
} }
const { copy, isSupported } = useClipboard(); const { copy, isSupported } = useClipboard({ legacy: true });
async function copyScript() { function copyScript() {
if (isSupported) { if (isSupported) {
await copy(props.requestResult?.responseResult.body || ''); copy(props.requestResult?.responseResult.body || '');
Message.success(t('common.copySuccess')); Message.success(t('common.copySuccess'));
} else { } else {
Message.warning(t('apiTestDebug.copyNotSupport')); Message.warning(t('apiTestDebug.copyNotSupport'));

View File

@ -367,7 +367,7 @@
}>(); }>();
const { t } = useI18n(); const { t } = useI18n();
const { copy, isSupported } = useClipboard(); const { copy, isSupported } = useClipboard({ legacy: true });
const previewDetail = ref<RequestParam>(props.detail); const previewDetail = ref<RequestParam>(props.detail);
const activeResponse = ref<TabItem & ResponseItem>(); const activeResponse = ref<TabItem & ResponseItem>();
@ -458,9 +458,9 @@
const activeDetailKey = ref(['request', 'response']); const activeDetailKey = ref(['request', 'response']);
async function copyScript(val: string) { function copyScript(val: string) {
if (isSupported) { if (isSupported) {
await copy(val); copy(val);
Message.success(t('common.copySuccess')); Message.success(t('common.copySuccess'));
} else { } else {
Message.warning(t('apiTestDebug.copyNotSupport')); Message.warning(t('apiTestDebug.copyNotSupport'));

View File

@ -74,7 +74,7 @@
}>(); }>();
const emit = defineEmits(['updateFollow']); const emit = defineEmits(['updateFollow']);
const { copy, isSupported } = useClipboard(); const { copy, isSupported } = useClipboard({ legacy: true });
const { t } = useI18n(); const { t } = useI18n();
const previewDetail = ref<RequestParam>(cloneDeep(props.detail)); const previewDetail = ref<RequestParam>(cloneDeep(props.detail));

View File

@ -125,7 +125,7 @@
(e: 'deleteCase', id: string): void; (e: 'deleteCase', id: string): void;
}>(); }>();
const { copy, isSupported } = useClipboard(); const { copy, isSupported } = useClipboard({ legacy: true });
const { t } = useI18n(); const { t } = useI18n();
const { openModal } = useModal(); const { openModal } = useModal();

View File

@ -236,7 +236,7 @@
const appStore = useAppStore(); const appStore = useAppStore();
const { t } = useI18n(); const { t } = useI18n();
const { openModal } = useModal(); const { openModal } = useModal();
const { copy, isSupported } = useClipboard(); const { copy, isSupported } = useClipboard({ legacy: true });
const moduleProtocol = ref('HTTP'); const moduleProtocol = ref('HTTP');
const moduleProtocolOptions = ref<SelectOptionData[]>([]); const moduleProtocolOptions = ref<SelectOptionData[]>([]);

View File

@ -156,7 +156,7 @@
(e: 'updateFollow'): void; (e: 'updateFollow'): void;
}>(); }>();
const { copy, isSupported } = useClipboard(); const { copy, isSupported } = useClipboard({ legacy: true });
const { t } = useI18n(); const { t } = useI18n();
const scenario = defineModel<Scenario>('scenario', { const scenario = defineModel<Scenario>('scenario', {