新增权限域名限制和链接背景上传
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user