修改版本和图片域名转换

This commit is contained in:
eoao
2025-09-04 01:22:00 +08:00
parent 4d31dbc9c4
commit 613582c13e
7 changed files with 32 additions and 23 deletions

View File

@@ -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() {

View File

@@ -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

View File

@@ -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();