diff --git a/mail-vue/src/layout/write/index.vue b/mail-vue/src/layout/write/index.vue index f7bf579..57aea1c 100644 --- a/mail-vue/src/layout/write/index.vue +++ b/mail-vue/src/layout/write/index.vue @@ -68,6 +68,7 @@ import {useEmailStore} from "@/store/email.js"; import {fileToBase64, formatBytes} from "@/utils/file-utils.js"; import {getIconByName} from "@/utils/icon-utils.js"; import sendPercent from "@/components/send-percent/index.vue" +import {toOssDomain} from "@/utils/convert.js"; import {formatDetailDate} from "@/utils/day.js"; import {useSettingStore} from "@/store/setting.js"; import {userDraftStore} from "@/store/draft.js"; @@ -336,7 +337,7 @@ function openReply(email) { function formatImage(content) { content = content || ''; const domain = settingStore.settings.r2Domain; - return content.replace(/{{domain}}/g, domain + '/'); + return content.replace(/{{domain}}/g, toOssDomain(domain) + '/'); } function open() { diff --git a/mail-vue/src/router/index.js b/mail-vue/src/router/index.js index 2d5d3ba..49bff62 100644 --- a/mail-vue/src/router/index.js +++ b/mail-vue/src/router/index.js @@ -84,6 +84,7 @@ NProgress.configure({ }); let timer +let first = true router.beforeEach((to, from, next) => { @@ -91,10 +92,9 @@ router.beforeEach((to, from, next) => { clearTimeout(timer) } - // 延迟 50ms 才启动进度条 timer = setTimeout(() => { NProgress.start() - }, 100) + }, first ? 200 : 100) const token = localStorage.getItem('token') @@ -118,19 +118,28 @@ router.beforeEach((to, from, next) => { function loadBackground(next) { const settingStore = useSettingStore(); - const src = cvtR2Url(settingStore.settings.background); - const img = new Image(); - img.src = src; + if (settingStore.settings.background) { - img.onload = () => { + const src = cvtR2Url(settingStore.settings.background); + + const img = new Image(); + img.src = src; + + img.onload = () => { + next() + }; + + img.onerror = () => { + console.warn("背景图片加载失败:", img.src); + next() + }; + + } else { next() - }; + } + - img.onerror = () => { - console.warn("背景图片加载失败:", img.src); - next() - }; } router.afterEach((to) => { @@ -151,6 +160,7 @@ router.afterEach((to) => { uiStore.asideShow = false } + first = false }) export default router diff --git a/mail-vue/src/views/sys-setting/index.vue b/mail-vue/src/views/sys-setting/index.vue index a7d444c..5457f3f 100644 --- a/mail-vue/src/views/sys-setting/index.vue +++ b/mail-vue/src/views/sys-setting/index.vue @@ -671,7 +671,7 @@ defineOptions({ name: 'sys-setting' }) -const currentVersion = 'v1.9.0' +const currentVersion = 'v2.0.0' const hasUpdate = ref(false) let getUpdateErrorCount = 1; const {t, locale} = useI18n(); diff --git a/mail-vue/vite.config.js b/mail-vue/vite.config.js index bc003fc..1061eb7 100644 --- a/mail-vue/vite.config.js +++ b/mail-vue/vite.config.js @@ -33,7 +33,6 @@ export default defineConfig(({mode}) => { ], }, workbox: { - navigateFallbackDenylist: [/^\/api\/init/], disableDevLogs: true, globPatterns: [], runtimeCaching: [], diff --git a/mail-worker/src/init/init.js b/mail-worker/src/init/init.js index 11e7631..db1d811 100644 --- a/mail-worker/src/init/init.js +++ b/mail-worker/src/init/init.js @@ -264,7 +264,7 @@ const init = { `ALTER TABLE setting ADD COLUMN site_key TEXT;`, `ALTER TABLE setting ADD COLUMN secret_key TEXT;`, `ALTER TABLE setting ADD COLUMN background TEXT;`, - `ALTER TABLE setting ADD COLUMN login_opacity INTEGER NOT NULL DEFAULT 0.80;`, + `ALTER TABLE setting ADD COLUMN login_opacity INTEGER NOT NULL DEFAULT 0.88;`, `ALTER TABLE user ADD COLUMN create_ip TEXT;`, `ALTER TABLE user ADD COLUMN active_ip TEXT;`, diff --git a/mail-worker/src/service/att-service.js b/mail-worker/src/service/att-service.js index 6b8e971..f6f22bd 100644 --- a/mail-worker/src/service/att-service.js +++ b/mail-worker/src/service/att-service.js @@ -22,7 +22,7 @@ const attService = { metadate.contentDisposition = `attachment; filename="${attachment.filename}"` } else { metadate.contentDisposition = `inline; filename="${attachment.filename}"` - metadate.cacheControl = `max-age=604800` + metadate.cacheControl = `max-age=259200` } await r2Service.putObj(c, attachment.key, attachment.content, metadate); @@ -119,7 +119,7 @@ const attService = { attData.type = attConst.type.EMBED; await r2Service.putObj(c, attData.key, attData.buff, { contentType: attData.mimeType, - cacheControl: `max-age=604800`, + cacheControl: `max-age=259200`, contentDisposition: `inline; filename="${attData.filename}"` }); } diff --git a/mail-worker/wrangler.toml b/mail-worker/wrangler.toml index bec0970..b8ec389 100644 --- a/mail-worker/wrangler.toml +++ b/mail-worker/wrangler.toml @@ -8,17 +8,16 @@ enabled = true #[[d1_databases]] #binding = "db" #d1数据库绑定名默认不可修改 -#database_name = "email" #d1数据库名字 -#database_id = "b1b1a63a-6ef5-4e6d-8e8c-b6d9e8feb810" #d1数据库id -# +#database_name = "" #d1数据库名字 +#database_id = "" #d1数据库id + #[[kv_namespaces]] #binding = "kv" #kv绑定名默认不可修改 -#id = "0fa01d4b299e481b9de060ece9e7785c" #kv数据库id +#id = "" #kv数据库id -##(可选) #[[r2_buckets]] #binding = "r2" #r2对象存储绑定名默认不可修改 -#bucket_name = "email" #r2对象存储桶的名字 +#bucket_name = "" #r2对象存储桶的名字 [assets] binding = "assets" #静态资源绑定名默认不可修改