fix: 修复站点链接问题 #197

This commit is contained in:
imsyy 2023-09-18 09:32:23 +08:00
parent 802cca0f44
commit 8cb8aba71f
5 changed files with 43 additions and 8 deletions

View File

@ -43,9 +43,9 @@ const changeBg = (type) => {
} else if (type == 1) { } else if (type == 1) {
bgUrl.value = "https://api.dujin.org/bing/1920.php"; bgUrl.value = "https://api.dujin.org/bing/1920.php";
} else if (type == 2) { } else if (type == 2) {
bgUrl.value = "https://api.btstu.cn/sjbz/api.php?lx=fengjing&format=images"; bgUrl.value = "https://api.aixiaowai.cn/gqapi/gqapi.php";
} else if (type == 3) { } else if (type == 3) {
bgUrl.value = "https://api.btstu.cn/sjbz/api.php?lx=dongman&format=images"; bgUrl.value = "https://api.aixiaowai.cn/api/api.php";
} }
}; };

View File

@ -9,7 +9,7 @@
- -
</span> </span>
{{ fullYear }} {{ fullYear }}
<a :href="SiteUrl">{{ SiteAnthor }}</a> <a :href="siteUrl">{{ siteAnthor }}</a>
</span> </span>
<!-- 以下信息请不要修改哦 --> <!-- 以下信息请不要修改哦 -->
<span class="hidden"> <span class="hidden">
@ -48,8 +48,16 @@ const fullYear = new Date().getFullYear();
// //
const siteStartDate = ref(import.meta.env.VITE_SITE_START); const siteStartDate = ref(import.meta.env.VITE_SITE_START);
const siteIcp = ref(import.meta.env.VITE_SITE_ICP); const siteIcp = ref(import.meta.env.VITE_SITE_ICP);
const SiteAnthor = ref(import.meta.env.VITE_SITE_ANTHOR); const siteAnthor = ref(import.meta.env.VITE_SITE_ANTHOR);
const SiteUrl = ref(import.meta.env.VITE_SITE_URL); const siteUrl = computed(() => {
const url = import.meta.env.VITE_SITE_URL;
if (!url) return "https://www.imsyy.top";
//
if (!url.startsWith("http://") && !url.startsWith("https://")) {
return "//" + url;
}
return url;
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -37,7 +37,16 @@ const store = mainStore();
// logo // logo
const siteLogo = import.meta.env.VITE_SITE_MAIN_LOGO; const siteLogo = import.meta.env.VITE_SITE_MAIN_LOGO;
// //
const siteUrl = import.meta.env.VITE_SITE_URL.split("."); const siteUrl = computed(() => {
const url = import.meta.env.VITE_SITE_URL;
if (!url) return "imsyy.top".split(".");
//
if (url.startsWith("http://") || url.startsWith("https://")) {
const urlFormat = url.replace(/^(https?:\/\/)/, "");
return urlFormat.split(".");
}
return url.split(".");
});
// //
const descriptionText = reactive({ const descriptionText = reactive({

View File

@ -19,7 +19,16 @@ import Link from "@/components/Links.vue";
const store = mainStore(); const store = mainStore();
// //
const siteUrl = import.meta.env.VITE_SITE_URL.split("."); const siteUrl = computed(() => {
const url = import.meta.env.VITE_SITE_URL;
if (!url) return "imsyy.top".split(".");
//
if (url.startsWith("http://") || url.startsWith("https://")) {
const urlFormat = url.replace(/^(https?:\/\/)/, "");
return urlFormat.split(".");
}
return url.split(".");
});
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -61,7 +61,16 @@ const store = mainStore();
const closeShow = ref(false); const closeShow = ref(false);
// //
const siteUrl = import.meta.env.VITE_SITE_URL.split("."); const siteUrl = computed(() => {
const url = import.meta.env.VITE_SITE_URL;
if (!url) return "imsyy.top".split(".");
//
if (url.startsWith("http://") || url.startsWith("https://")) {
const urlFormat = url.replace(/^(https?:\/\/)/, "");
return urlFormat.split(".");
}
return url.split(".");
});
// //
const upData = reactive({ const upData = reactive({