修复邮件列表截取文字加载图片导致大量爆红

This commit is contained in:
eoao
2025-07-04 21:11:41 +08:00
parent fc249dde6e
commit cfebeb1fda
8 changed files with 19 additions and 10 deletions

View File

@@ -296,7 +296,11 @@ function htmlToText(email) {
if (email.content) {
const tempDiv = document.createElement('div');
tempDiv.innerHTML = email.content;
tempDiv.innerHTML = email.content.replace(
/<(img|iframe|object|embed|video|audio|source|link)[^>]*>/gi, ''
);
const scriptsAndStyles = tempDiv.querySelectorAll('script, style, title');
scriptsAndStyles.forEach(el => el.remove());
let text = tempDiv.textContent || tempDiv.innerText || '';

View File

@@ -366,6 +366,11 @@ function submit() {
})
}
</script>
<style>
path[fill="#ffdda1"] {
fill: #ffdd7d;
}
</style>
<style scoped lang="scss">
.account-box {

View File

@@ -84,7 +84,7 @@ const openSelect = () => {
const params = reactive({
timeSort: 0,
type: 'all',
type: 'receive',
userEmail: null,
accountEmail: null,
name: null,
@@ -102,7 +102,7 @@ const selectTitle = computed(() => {
function refreshBefore() {
searchValue.value = null
params.timeSort = 0
params.type = 'all'
params.type = 'receive'
params.userEmail = null
params.accountEmail = null
params.name = null

View File

@@ -260,7 +260,7 @@
<Icon icon="logos:telegram" width="30" height="30"/>
</template>
</el-button>
<el-button @click="jump('https://github.com/arexing/cloud-mail')">
<el-button @click="jump('https://github.com/LaziestRen/cloud-mail')">
github
<template #icon>
<Icon icon="codicon:github-inverted" width="22" height="22" />