网站:顶级域名改为自定义域名
This commit is contained in:
+2
-2
@@ -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
@@ -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');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user