网站:顶级域名改为自定义域名

This commit is contained in:
2024-09-06 13:12:18 +08:00
parent 4b2c4bd9e6
commit 9438021a08
7 changed files with 73 additions and 71 deletions
+2 -2
View File
@@ -70,7 +70,6 @@ export function openUrl(url: string, params?: any): void {
*/
export function openSpmUrl(path: string, d?: any, id = 0): void {
const domain = getSiteDomain();
console.log(domain);
const spm = ref<string>('');
const token = ref<string>();
const url = ref<string>();
@@ -98,7 +97,8 @@ export function openSpmUrl(path: string, d?: any, id = 0): void {
// 跳转页面
url.value = `${domain}${path}${spm.value}${token.value}`;
window.open(`https://${url.value}`);
console.log(url.value,'domain>>>>');
window.open(`${url.value}`);
}
/**
+6 -2
View File
@@ -113,8 +113,12 @@ export function getSiteDomain(): string {
listWebsite({ limit: 1 }).then((list) => {
if (list.length > 0) {
const d = list[0];
localStorage.setItem('Domain', `${d.prefix}${d.domain}`);
return `${d.prefix}${d.domain}`;
if (d.domain) {
localStorage.setItem('Domain', `https://${d.domain}`);
} else {
localStorage.setItem('Domain', `https://$${d.websiteCode}.wsdns.cn`);
}
return localStorage.getItem('Domain');
}
});
}