feat: markdown移动端兼容

This commit is contained in:
Gsh
2026-01-04 00:32:01 +08:00
parent accbaf3ecb
commit a437d55f9f
4 changed files with 43 additions and 1 deletions

View File

@@ -47,6 +47,44 @@ async function handleDownload() {
window.open(props.task.storeUrl, '_blank');
}
}
// 下载方案2
/* async function handleDownload() {
if (!props.task.storeUrl) return;
// 显示操作选项
const userChoice = confirm(
'由于浏览器安全限制,图片需要手动保存。\n\n' +
'点击"确定"在新窗口打开图片,然后右键选择"另存为..."。\n' +
'点击"取消"尝试直接下载(可能不成功)。'
);
if (userChoice) {
// 用户选择手动保存
window.open(props.task.storeUrl, '_blank');
} else {
// 尝试自动下载
try {
// 创建一个临时表单提交(绕过某些限制)
const form = document.createElement('form');
form.method = 'GET';
form.action = props.task.storeUrl;
form.target = '_blank';
document.body.appendChild(form);
form.submit();
document.body.removeChild(form);
// 同时尝试a标签
const link = document.createElement('a');
link.href = props.task.storeUrl;
link.download = `image-${Date.now()}.png`;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
} catch (e) {
window.open(props.task.storeUrl, '_blank');
}
}
} */
</script>
<template>

View File

@@ -50,6 +50,8 @@
/* markdown 内容元素优化 */
.markdown-body {
font-size: 14px !important;
max-width: calc(100vw - 80px);
pre {
max-width: 100%;

View File

@@ -16,7 +16,6 @@ declare module 'vue' {
DeepThinking: typeof import('./../src/components/DeepThinking/index.vue')['default']
ElAlert: typeof import('element-plus/es')['ElAlert']
ElAvatar: typeof import('element-plus/es')['ElAvatar']
ElBadge: typeof import('element-plus/es')['ElBadge']
ElButton: typeof import('element-plus/es')['ElButton']
ElCard: typeof import('element-plus/es')['ElCard']
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
@@ -26,6 +25,8 @@ declare module 'vue' {
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
ElContainer: typeof import('element-plus/es')['ElContainer']
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
ElDialog: typeof import('element-plus/es')['ElDialog']
ElDivider: typeof import('element-plus/es')['ElDivider']
ElDrawer: typeof import('element-plus/es')['ElDrawer']

View File

@@ -7,6 +7,7 @@ interface ImportMetaEnv {
readonly VITE_WEB_BASE_API: string;
readonly VITE_API_URL: string;
readonly VITE_FILE_UPLOAD_API: string;
readonly VITE_BUILD_COMPRESS: string;
readonly VITE_SSO_SEVER_URL: string;
readonly VITE_APP_VERSION: string;
}