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

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) { if (email.content) {
const tempDiv = document.createElement('div'); 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'); const scriptsAndStyles = tempDiv.querySelectorAll('script, style, title');
scriptsAndStyles.forEach(el => el.remove()); scriptsAndStyles.forEach(el => el.remove());
let text = tempDiv.textContent || tempDiv.innerText || ''; let text = tempDiv.textContent || tempDiv.innerText || '';

View File

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

View File

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

View File

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -6,8 +6,8 @@
<title></title> <title></title>
<link rel="icon" href="/assets/favicon-C5dAZutX.svg" type="image/svg+xml"> <link rel="icon" href="/assets/favicon-C5dAZutX.svg" type="image/svg+xml">
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script> <script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
<script type="module" crossorigin src="/assets/index-DF2JN91G.js"></script> <script type="module" crossorigin src="/assets/index-Cv-M2b0c.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-CwHyta7E.css"> <link rel="stylesheet" crossorigin href="/assets/index-DIaq3OYL.css">
</head> </head>
<body> <body>
<div id="loading-first"> <div id="loading-first">