新增权限域名限制和链接背景上传

This commit is contained in:
eoao
2025-07-26 23:11:00 +08:00
parent 0e86b93e0c
commit 12833cd901
36 changed files with 584 additions and 354 deletions

View File

@@ -1,5 +1,24 @@
import {useSettingStore} from "@/store/setting.js";
export function cvtR2Url(key) {
const settingStore = useSettingStore();
return settingStore.settings.r2Domain + '/' + key
if (!key) {
return + 'https://' + ''
}
if (key.startsWith('https://')) {
return key
}
const { settings } = useSettingStore();
let domain = settings.r2Domain
if (!domain.startsWith('http')) {
return 'https://' + domain + '/' + key
}
if (domain.endsWith("/")) {
domain = domain.slice(0, -1);
}
return domain + '/' + key
}